diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 97b737864d..8b7fa2902e 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,12 @@ 2002-12-01 13:30 UTC+0100 Foo Bar */ +2007-10-23 02:24 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) + * harbour/common.mak + * harbour/source/vm/mainwin.c + * harbour/source/common/hbwince.c + ! fixed compilation with Unicode support and standard MS-Windows + 2007-10-22 21:04 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/source/rdd/wacore.c * harbour/source/rdd/dbcmd.c diff --git a/harbour/common.mak b/harbour/common.mak index b8d3042da2..f11a93b3cd 100644 --- a/harbour/common.mak +++ b/harbour/common.mak @@ -289,6 +289,7 @@ COMMON_LIB_OBJS = \ $(OBJ_DIR)\hbfhnd$(OBJEXT) \ $(OBJ_DIR)\hbfsapi$(OBJEXT) \ $(OBJ_DIR)\hbgete$(OBJEXT) \ + $(OBJ_DIR)\hbwince$(OBJEXT) \ $(OBJ_DIR)\hbhash$(OBJEXT) \ $(OBJ_DIR)\hbdate$(OBJEXT) \ $(OBJ_DIR)\hbstr$(OBJEXT) \ diff --git a/harbour/source/common/hbwince.c b/harbour/source/common/hbwince.c index 3df23dee97..e4cf8cf1f8 100644 --- a/harbour/source/common/hbwince.c +++ b/harbour/source/common/hbwince.c @@ -187,7 +187,7 @@ void hb_wctombget( char *dstA, const wchar_t *srcW, unsigned long ulLen ) WideCharToMultiByte( CP_ACP, 0, srcW, ulLen, dstA, ulLen, NULL, NULL ); } -#if defined(UNICODE) +#if defined(HB_WINCE) DWORD WINAPI GetEnvironmentVariableA( LPCSTR name, LPSTR value, DWORD size ) { @@ -356,7 +356,7 @@ UINT WINAPI SetErrorMode( UINT mode ) return 0; } -HANDLE CreateFileA( LPCSTR filename, DWORD access, +HANDLE WINAPI CreateFileA( LPCSTR filename, DWORD access, DWORD sharing, LPSECURITY_ATTRIBUTES sa, DWORD creation, DWORD attributes, HANDLE template ) { @@ -370,7 +370,7 @@ HANDLE CreateFileA( LPCSTR filename, DWORD access, return h; } -BOOL MoveFileA( LPCSTR fn1, LPCSTR fn2 ) +BOOL WINAPI MoveFileA( LPCSTR fn1, LPCSTR fn2 ) { LPWSTR wfn1, wfn2; BOOL b; @@ -384,7 +384,7 @@ BOOL MoveFileA( LPCSTR fn1, LPCSTR fn2 ) return b; } -BOOL DeleteFileA( LPCSTR path ) +BOOL WINAPI DeleteFileA( LPCSTR path ) { LPWSTR wpath; BOOL b; @@ -396,7 +396,7 @@ BOOL DeleteFileA( LPCSTR path ) return b; } -BOOL RemoveDirectoryA( LPCSTR path ) +BOOL WINAPI RemoveDirectoryA( LPCSTR path ) { LPWSTR wpath; BOOL b; diff --git a/harbour/source/vm/mainwin.c b/harbour/source/vm/mainwin.c index c2094e3723..ecb54250f0 100644 --- a/harbour/source/vm/mainwin.c +++ b/harbour/source/vm/mainwin.c @@ -73,9 +73,14 @@ static int s_argc = 0; static char * s_argv[ MAX_ARGS ]; static char s_szAppName[ MAX_PATH ]; +#if defined( HB_WINCE ) +# define HB_LPSTR LPWSTR +#else +# define HB_LPSTR LPSTR +#endif int WINAPI WinMain( HINSTANCE hInstance, /* handle to current instance */ HINSTANCE hPrevInstance, /* handle to previous instance */ - LPTSTR lpCmdLine, /* pointer to command line */ + HB_LPSTR lpCmdLine, /* pointer to command line */ int iCmdShow ) /* show state of window */ { TCHAR szAppName[ MAX_PATH ]; @@ -101,7 +106,11 @@ int WINAPI WinMain( HINSTANCE hInstance, /* handle to current instance */ pArg = NULL; +#if defined( HB_WINCE ) pSrc = pFree = HB_TCHAR_CONVFROM( lpCmdLine ); +#else + pSrc = pFree = lpCmdLine; +#endif pDst = pArgs = ( LPSTR ) LocalAlloc( LMEM_FIXED, strlen( pFree ) + 1 ); fQuoted = FALSE; @@ -136,7 +145,9 @@ int WINAPI WinMain( HINSTANCE hInstance, /* handle to current instance */ s_argv[ s_argc++ ] = pArg; } +#if defined( HB_WINCE ) HB_TCHAR_FREE( pFree ); +#endif hb_winmainArgInit( hInstance, hPrevInstance, iCmdShow ); hb_cmdargInit( s_argc, s_argv );