summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--navit/file.c4
-rw-r--r--navit/graphics/win32/graphics_win32.c12
-rw-r--r--navit/gui/win32/gui_win32.c16
-rw-r--r--navit/start.c2
-rw-r--r--navit/support/ezxml/ezxml.c2
-rw-r--r--navit/support/glib/gmessages.c6
6 files changed, 27 insertions, 15 deletions
diff --git a/navit/file.c b/navit/file.c
index c8d7176f9..06d60ae45 100644
--- a/navit/file.c
+++ b/navit/file.c
@@ -93,7 +93,11 @@ int file_mkdir(char *name, int pflag)
if (!pflag) {
if (file_is_dir(name))
return 0;
+#ifdef HAVE_API_WIN32_BASE
+ return mkdir(name);
+#else
return mkdir(name, 0777);
+#endif
}
strcpy(buffer, name);
next=buffer;
diff --git a/navit/graphics/win32/graphics_win32.c b/navit/graphics/win32/graphics_win32.c
index 111576606..88144cbcc 100644
--- a/navit/graphics/win32/graphics_win32.c
+++ b/navit/graphics/win32/graphics_win32.c
@@ -46,12 +46,12 @@ HFONT EzCreateFont (HDC hdc, TCHAR * szFaceName, int iDeciPtHeight,
SaveDC (hdc) ;
-#ifndef __CEGCC__
+#ifndef HAVE_API_WIN32_CE
SetGraphicsMode (hdc, GM_ADVANCED) ;
ModifyWorldTransform (hdc, NULL, MWT_IDENTITY) ;
#endif
SetViewportOrgEx (hdc, 0, 0, NULL) ;
-#ifndef __CEGCC__
+#ifndef HAVE_API_WIN32_CE
SetWindowOrgEx (hdc, 0, 0, NULL) ;
#endif
@@ -72,7 +72,7 @@ HFONT EzCreateFont (HDC hdc, TCHAR * szFaceName, int iDeciPtHeight,
pt.x = (int) (iDeciPtWidth * cxDpi / 72) ;
pt.y = (int) (iDeciPtHeight * cyDpi / 72) ;
-#ifndef __CEGCC__
+#ifndef HAVE_API_WIN32_CE
DPtoLP (hdc, &pt, 1) ;
#endif
lf.lfHeight = - (int) (fabs (pt.y) / 10.0 + 0.5) ;
@@ -326,7 +326,7 @@ static const char g_szClassName[] = "NAVGRA";
static HANDLE CreateGraphicsWindows( struct graphics_priv* gr )
{
-#ifdef __CEGCC__
+#ifdef HAVE_API_WIN32_CE
WNDCLASS wc;
#else
WNDCLASSEX wc;
@@ -349,7 +349,7 @@ static HANDLE CreateGraphicsWindows( struct graphics_priv* gr )
GetClientRect( gr->wnd_parent_handle,&rcParent);
-#ifdef __CEGCC__
+#ifdef HAVE_API_WIN32_CE
if(!RegisterClass(&wc))
#else
if(!RegisterClassEx(&wc))
@@ -361,7 +361,7 @@ static HANDLE CreateGraphicsWindows( struct graphics_priv* gr )
gr->width = rcParent.right - rcParent.left;
gr->height = rcParent.bottom - rcParent.top;
-#if defined(__CEGCC__)
+#ifdef HAVE_API_WIN32_CE
callback_list_call_attr_2(gr->cbl, attr_resize, (void *)gr->width, (void *)gr->height);
#endif
diff --git a/navit/gui/win32/gui_win32.c b/navit/gui/win32/gui_win32.c
index f8f7e2074..e551813ad 100644
--- a/navit/gui/win32/gui_win32.c
+++ b/navit/gui/win32/gui_win32.c
@@ -84,6 +84,7 @@ static void CreateToolBar(HWND hwnd)
HWND hTool;
TBBUTTON tbb[8];
TBADDBITMAP tbab;
+#if 0
#ifdef _WIN32_WCE
/* Have to initialize common controls under CE */
INITCOMMONCONTROLSEX iccex;
@@ -91,6 +92,7 @@ static void CreateToolBar(HWND hwnd)
iccex.dwICC = ICC_BAR_CLASSES;
InitCommonControlsEx (&iccex);
#endif
+#endif
hTool = CreateWindowEx(0, TOOLBARCLASSNAME, NULL, WS_CHILD | WS_VISIBLE, 0, 0, 0, 0,
hwnd, (HMENU)ID_CHILD_TOOLBAR, GetModuleHandle(NULL), NULL);
@@ -169,7 +171,7 @@ static void CreateToolBar(HWND hwnd)
static void window_layout( HWND hwnd )
{
-#ifndef __CEGCC__
+#ifndef HAVE_API_WIN32_CE
RECT rcClient;
RECT rcTool;
int iToolHeight;
@@ -251,7 +253,7 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM l
AppendMenu(hSubMenu, MF_STRING, ID_STUFF_GO, TEXT("&Go"));
AppendMenu(hMenu, MF_STRING | MF_POPUP, (UINT)hSubMenu, TEXT("&Stuff"));
-#ifndef __CEGCC__
+#ifndef HAVE_API_WIN32_CE
SetMenu(hwnd, hMenu);
#endif
@@ -360,7 +362,7 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM l
}
}
break;
-#ifdef __CEGCC__
+#ifdef HAVE_API_WIN32_CE
case WM_KEYDOWN:
{
struct point p;
@@ -404,7 +406,7 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM l
HANDLE CreateWin32Window( void )
{
-#ifdef __CEGCC__
+#ifdef HAVE_API_WIN32_CE
WNDCLASS wc;
#else
WNDCLASSEX wc;
@@ -425,7 +427,7 @@ HANDLE CreateWin32Window( void )
wc.lpszClassName = g_szClassName;
wc.hIcon = LoadIcon(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_NAVIT));
-#ifdef __CEGCC__
+#ifdef HAVE_API_WIN32_CE
if(!RegisterClass(&wc))
#else
if(!RegisterClassEx(&wc))
@@ -440,7 +442,7 @@ HANDLE CreateWin32Window( void )
WS_EX_CLIENTEDGE,
g_szClassName,
TEXT( "Navit" ),
-#if defined(__CEGCC__)
+#ifdef HAVE_API_WIN32_CE
WS_SYSMENU | WS_CLIPCHILDREN,
CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
#else
@@ -609,7 +611,7 @@ struct gui_methods win32_gui_methods = {
static struct gui_priv *win32_gui_new( struct navit *nav, struct gui_methods *meth, struct attr **attrs)
{
struct gui_priv *this_;
-#ifdef __CEGCC__
+#ifdef HAVE_API_WIN32_CE
/* Do not run multiple instances under CE */
HWND prev;
prev = FindWindow(g_szClassName, NULL);
diff --git a/navit/start.c b/navit/start.c
index 621f708e2..a98c3bdcb 100644
--- a/navit/start.c
+++ b/navit/start.c
@@ -161,7 +161,7 @@ int main(int argc, char **argv)
#ifdef HAVE_GLIB
event_request_system("glib","start");
#endif
-#ifdef __CEGCC__
+#ifdef HAVE_API_WIN32_CE
config_file="\\Storage Card\\navit.xml";
#endif
if (!config_load(config_file, &error)) {
diff --git a/navit/support/ezxml/ezxml.c b/navit/support/ezxml/ezxml.c
index 82b11fb99..7095c7757 100644
--- a/navit/support/ezxml/ezxml.c
+++ b/navit/support/ezxml/ezxml.c
@@ -630,7 +630,7 @@ ezxml_t ezxml_parse_fd(int fd)
size_t l;
void *m;
- if (fd < 0) return NULL;
+ if (fd == -1) return NULL;
fstat(fd, &st);
#ifndef EZXML_NOMMAP
diff --git a/navit/support/glib/gmessages.c b/navit/support/glib/gmessages.c
index 6790c7595..25a0769bc 100644
--- a/navit/support/glib/gmessages.c
+++ b/navit/support/glib/gmessages.c
@@ -48,6 +48,7 @@
#include "gprintfint.h"
#include "gthreadprivate.h"
#include "galias.h"
+#include "config.h"
#if NOT_NEEDED_FOR_NAVIT
#ifdef G_OS_WIN32
@@ -1061,8 +1062,13 @@ gsize
g_printf_string_upper_bound (const gchar *format,
va_list args)
{
+#ifdef HAVE_API_WIN32_CE
+ gchar c[16384];
+ return _g_vsnprintf (c, 16384, format, args) + 1;
+#else
gchar c;
return _g_vsnprintf (&c, 1, format, args) + 1;
+#endif
}
#if NOT_NEEDED_FOR_NAVIT