diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 178a1f97f1..0e16ee22ce 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,12 @@ 2002-12-01 13:30 UTC+0100 Foo Bar */ +2007-11-14 19:00 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl) + * harbour/include/hbwince.h + * harbour/source/common/hbwince.c + * harbour/utils/hbver/hbverfix.c + * modified for clean compilation with POCC/XCC and ARM processors + 2007-11-14 17:07 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/harbour-ce-spec * harbour/harbour-w32-spec diff --git a/harbour/include/hbwince.h b/harbour/include/hbwince.h index ec026ccd97..45a04e5e25 100644 --- a/harbour/include/hbwince.h +++ b/harbour/include/hbwince.h @@ -144,6 +144,17 @@ extern char *strerror( int errnum ); BOOL WINAPI GetKeyboardState( PBYTE p ); BOOL WINAPI SetKeyboardState( PBYTE p ); + #if defined( __POCC__ ) || defined( __XCC__ ) + #define GlobalAlloc(flags, cb) LocalAlloc(flags, cb) + #define GlobalLock(lp) LocalLock(lp) + #define GlobalUnlock(lp) LocalUnlock(lp) + #define GlobalSize(lp) LocalSize(lp) + #define GlobalFree(h) LocalFree(h) + #define GlobalReAlloc(h, cb, flags) LocalReAlloc(h, cb, flags) + #define GlobalHandle(lp) LocalHandle(lp) + #define GlobalFlags(lp) LocalFlags(lp) + #endif + #endif /* HB_OS_WIN_32_USED && _MSC_VER */ #endif /* HB_WINCE */ diff --git a/harbour/source/common/hbwince.c b/harbour/source/common/hbwince.c index 5101a7cceb..e991fd8f6a 100644 --- a/harbour/source/common/hbwince.c +++ b/harbour/source/common/hbwince.c @@ -653,7 +653,7 @@ BOOL WINAPI SetKeyboardState( PBYTE p ) return FALSE; } -#ifndef _MSC_VER +#if !defined( _MSC_VER ) || defined( __POCC__ ) || defined( __XCC__ ) PVOID WINAPI LocalLock( HLOCAL h ) { HB_SYMBOL_UNUSED( h ); @@ -667,7 +667,7 @@ BOOL WINAPI LocalUnlock( HLOCAL h ) return FALSE; } -#endif /* _MSC_VER */ +#endif /* !_MSC_VER || __POCC__ || __XCC__ */ #endif /* UNICODE */ diff --git a/harbour/utils/hbver/hbverfix.c b/harbour/utils/hbver/hbverfix.c index cbf5207e0c..d99a2d524d 100644 --- a/harbour/utils/hbver/hbverfix.c +++ b/harbour/utils/hbver/hbverfix.c @@ -74,6 +74,10 @@ #define MAX_BUF_LEN 4096 #if defined(HB_WINCE) + +#define hb_xgrab(x) malloc(x) +#define hb_xfree(x) free(x) + wchar_t *hb_mbtowc( const char * srcA ) { DWORD length; @@ -86,6 +90,23 @@ wchar_t *hb_mbtowc( const char * srcA ) return dstW; } +char *hb_wctomb( const wchar_t *srcW ) +{ + DWORD length; + char *dstA; + + length = WideCharToMultiByte( CP_ACP, 0, srcW, -1, NULL, 0, NULL, NULL ); + dstA = ( char * ) hb_xgrab( length + 1 ); + WideCharToMultiByte( CP_ACP, 0, srcW, -1, dstA, length + 1, NULL, NULL ); + + return dstA; +} + +void hb_wctombget( char *dstA, const wchar_t *srcW, unsigned long ulLen ) +{ + WideCharToMultiByte( CP_ACP, 0, srcW, ulLen, dstA, ulLen, NULL, NULL ); +} + int remove( const char * path ) { wchar_t * wpath; @@ -410,3 +431,7 @@ int main( int argc, char * argv[] ) } return 0; } + +#if defined( HB_WINCE ) && !defined( __CEGCC__ ) +# include "hbwmain.c" +#endif