diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 3f91c97300..ace1affb18 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,49 @@ 2008-12-31 13:59 UTC+0100 Foo Bar (foo.bar foobar.org) */ +2008-09-10 13:22 UTC+0200 Viktor Szakats (harbour.01 syenar hu) + * doc/whatsnew.txt + + Updated. + + * contrib/hbw32/Makefile + * contrib/hbw32/common.mak + - contrib/hbw32/w32_prn.c + + contrib/hbw32/win_prn1.c + - contrib/hbw32/tprinter.c + + contrib/hbw32/win_prn2.c + - contrib/hbw32/dllcall.c + + contrib/hbw32/win_dll.c + - contrib/hbw32/w32_osc.c + + contrib/hbw32/win_osc.c + - contrib/hbw32/w32_ole.c + + contrib/hbw32/win_ole.c + - contrib/hbw32/w32_regc.c + + contrib/hbw32/win_regc.c + - contrib/hbw32/w32_os.prg + + contrib/hbw32/win_os.prg + - contrib/hbw32/w32_tole.prg + + contrib/hbw32/win_tole.prg + - contrib/hbw32/w32_reg.prg + + contrib/hbw32/win_reg.prg + - contrib/hbw32/w32_tprn.prg + + contrib/hbw32/win_tprn.prg + * Cleaned some 'w32'. + + * contrib/hbwhat/hbwhat.h + ! Hack to disable UNICODE if enabled. + hbwhat cannot currently be compiled in UNICODE mode. + + * contrib/hbwhat/wincorec.c + * contrib/hbwhat/whtmisc.c + % Made some internal functions static by moving them around. + ! Removed TEXT( ) type of syntax. + + * contrib/hbodbc/odbc.c + ! MSVC warning fixed in the UNICODE path. + + * contrib/hbnf/getenvrn.c + ! Fixed to compile in Windows/UNICODE mode. + 2008-09-10 09:46 UTC+0200 Viktor Szakats (harbour.01 syenar hu) * doc/whatsnew.txt + Updated. diff --git a/harbour/contrib/hbnf/getenvrn.c b/harbour/contrib/hbnf/getenvrn.c index 0f6070e4f4..a628004547 100644 --- a/harbour/contrib/hbnf/getenvrn.c +++ b/harbour/contrib/hbnf/getenvrn.c @@ -185,15 +185,15 @@ HB_FUNC( FT_GETE ) } #elif defined(HB_OS_WIN_32) { - - char *buffer = NULL; - LPVOID lpEnviron = GetEnvironmentStringsA(); + LPVOID lpEnviron = GetEnvironmentStrings(); char *sCurEnv; int x; int buffsize = 0; int rettype = NORETURN; + char * szEnviron = HB_TCHAR_CONVFROM( lpEnviron ); + if( ISCHAR( 1 ) ) rettype = CHARTYPE; if( ISARRAY( 1 ) ) @@ -202,7 +202,7 @@ HB_FUNC( FT_GETE ) if( rettype == CHARTYPE ) /* scan strings first and add up total size */ { - for( sCurEnv = ( LPSTR ) lpEnviron; *sCurEnv; sCurEnv++ ) + for( sCurEnv = szEnviron; *sCurEnv; sCurEnv++ ) { if( !*sCurEnv ) /* null string, we're done */ @@ -222,7 +222,7 @@ HB_FUNC( FT_GETE ) buffer[0] = '\0'; } x = 0; - for( sCurEnv = ( LPSTR ) lpEnviron; *sCurEnv; sCurEnv++ ) + for( sCurEnv = szEnviron; *sCurEnv; sCurEnv++ ) { if( !*sCurEnv ) /* null string, we're done */ @@ -254,6 +254,7 @@ HB_FUNC( FT_GETE ) /* return number of strings found */ hb_retni( x ); + HB_TCHAR_FREE( szEnviron ); FreeEnvironmentStrings( ( LPTSTR ) lpEnviron ); } diff --git a/harbour/contrib/hbodbc/odbc.c b/harbour/contrib/hbodbc/odbc.c index 5839411bde..6720ef3914 100644 --- a/harbour/contrib/hbodbc/odbc.c +++ b/harbour/contrib/hbodbc/odbc.c @@ -187,11 +187,11 @@ HB_FUNC( SQLCONNECT ) /* HB_SQLCONNECT( hDbc, cDSN, cUseName, cPassword ) --> nR ret = SQLConnect( ( HDBC ) hb_parptr( 1 ), lpDSN, - hb_parclen( 2 ), + ( SQLSMALLINT ) hb_parclen( 2 ), lpUseName, - hb_parclen( 3 ), + ( SQLSMALLINT ) hb_parclen( 3 ), lpPassword, - hb_parclen( 4 ) ); + ( SQLSMALLINT ) hb_parclen( 4 ) ); HB_TCHAR_FREE( lpDSN ); HB_TCHAR_FREE( lpUseName ); diff --git a/harbour/contrib/hbw32/Makefile b/harbour/contrib/hbw32/Makefile index 55f8be4f76..64d8209aef 100644 --- a/harbour/contrib/hbw32/Makefile +++ b/harbour/contrib/hbw32/Makefile @@ -9,18 +9,18 @@ LIBNAME=hbw32 ifeq ($(HB_ARCHITECTURE),w32) C_SOURCES=\ - dllcall.c \ - tprinter.c \ - w32_ole.c \ - w32_osc.c \ - w32_prn.c \ - w32_regc.c \ + win_dll.c \ + win_ole.c \ + win_osc.c \ + win_prn1.c \ + win_prn2.c \ + win_regc.c \ PRG_SOURCES=\ - w32_os.prg \ - w32_reg.prg \ - w32_tole.prg \ - w32_tprn.prg \ + win_os.prg \ + win_reg.prg \ + win_tole.prg \ + win_tprn.prg \ PRG_HEADERS = \ hbw32.ch \ diff --git a/harbour/contrib/hbw32/common.mak b/harbour/contrib/hbw32/common.mak index 826257eff1..a712469246 100644 --- a/harbour/contrib/hbw32/common.mak +++ b/harbour/contrib/hbw32/common.mak @@ -10,17 +10,17 @@ PRG_HEADERS = \ hbw32.ch \ LIB_OBJS = \ - $(OBJ_DIR)dllcall$(OBJEXT) \ - $(OBJ_DIR)tprinter$(OBJEXT) \ - $(OBJ_DIR)w32_ole$(OBJEXT) \ - $(OBJ_DIR)w32_osc$(OBJEXT) \ - $(OBJ_DIR)w32_prn$(OBJEXT) \ - $(OBJ_DIR)w32_regc$(OBJEXT) \ + $(OBJ_DIR)win_dll$(OBJEXT) \ + $(OBJ_DIR)win_ole$(OBJEXT) \ + $(OBJ_DIR)win_osc$(OBJEXT) \ + $(OBJ_DIR)win_prn1$(OBJEXT) \ + $(OBJ_DIR)win_prn2$(OBJEXT) \ + $(OBJ_DIR)win_regc$(OBJEXT) \ \ - $(OBJ_DIR)w32_os$(OBJEXT) \ - $(OBJ_DIR)w32_reg$(OBJEXT) \ - $(OBJ_DIR)w32_tole$(OBJEXT) \ - $(OBJ_DIR)w32_tprn$(OBJEXT) \ + $(OBJ_DIR)win_os$(OBJEXT) \ + $(OBJ_DIR)win_reg$(OBJEXT) \ + $(OBJ_DIR)win_tole$(OBJEXT) \ + $(OBJ_DIR)win_tprn$(OBJEXT) \ all: \ $(LIB_PATH) \ diff --git a/harbour/contrib/hbw32/dllcall.c b/harbour/contrib/hbw32/win_dll.c similarity index 100% rename from harbour/contrib/hbw32/dllcall.c rename to harbour/contrib/hbw32/win_dll.c diff --git a/harbour/contrib/hbw32/w32_ole.c b/harbour/contrib/hbw32/win_ole.c similarity index 100% rename from harbour/contrib/hbw32/w32_ole.c rename to harbour/contrib/hbw32/win_ole.c diff --git a/harbour/contrib/hbw32/w32_os.prg b/harbour/contrib/hbw32/win_os.prg similarity index 100% rename from harbour/contrib/hbw32/w32_os.prg rename to harbour/contrib/hbw32/win_os.prg diff --git a/harbour/contrib/hbw32/w32_osc.c b/harbour/contrib/hbw32/win_osc.c similarity index 100% rename from harbour/contrib/hbw32/w32_osc.c rename to harbour/contrib/hbw32/win_osc.c diff --git a/harbour/contrib/hbw32/w32_prn.c b/harbour/contrib/hbw32/win_prn1.c similarity index 100% rename from harbour/contrib/hbw32/w32_prn.c rename to harbour/contrib/hbw32/win_prn1.c diff --git a/harbour/contrib/hbw32/tprinter.c b/harbour/contrib/hbw32/win_prn2.c similarity index 100% rename from harbour/contrib/hbw32/tprinter.c rename to harbour/contrib/hbw32/win_prn2.c diff --git a/harbour/contrib/hbw32/w32_reg.prg b/harbour/contrib/hbw32/win_reg.prg similarity index 100% rename from harbour/contrib/hbw32/w32_reg.prg rename to harbour/contrib/hbw32/win_reg.prg diff --git a/harbour/contrib/hbw32/w32_regc.c b/harbour/contrib/hbw32/win_regc.c similarity index 100% rename from harbour/contrib/hbw32/w32_regc.c rename to harbour/contrib/hbw32/win_regc.c diff --git a/harbour/contrib/hbw32/w32_tole.prg b/harbour/contrib/hbw32/win_tole.prg similarity index 100% rename from harbour/contrib/hbw32/w32_tole.prg rename to harbour/contrib/hbw32/win_tole.prg diff --git a/harbour/contrib/hbw32/w32_tprn.prg b/harbour/contrib/hbw32/win_tprn.prg similarity index 100% rename from harbour/contrib/hbw32/w32_tprn.prg rename to harbour/contrib/hbw32/win_tprn.prg diff --git a/harbour/contrib/hbwhat/hbwhat.h b/harbour/contrib/hbwhat/hbwhat.h index fdc82daed0..d704603294 100644 --- a/harbour/contrib/hbwhat/hbwhat.h +++ b/harbour/contrib/hbwhat/hbwhat.h @@ -2,6 +2,13 @@ * $Id$ */ +/* TOFIX: Hack to make it compile when UNICODE is set. + This library doesn't support UNICODE yet (?), so we + disable it to avoid build problems. [vszakats] */ +#ifdef UNICODE + #undef UNICODE +#endif + //#define HB_PARWH( x ) hb_parnl( x ) //#define HB_RETWH( x ) hb_retnl( ( LONG ) x ) //#define HB_STORWH( x, y ) hb_stornl( ( LONG ) x, y ) diff --git a/harbour/contrib/hbwhat/whtmisc.c b/harbour/contrib/hbwhat/whtmisc.c index 4d9c897b4d..5d58fe94a3 100644 --- a/harbour/contrib/hbwhat/whtmisc.c +++ b/harbour/contrib/hbwhat/whtmisc.c @@ -447,54 +447,6 @@ HB_FUNC( WINEXEC ) hb_retni( WinExec( (LPCSTR) hb_parcx( 1 ), (UINT) hb_parni( 2 ) ) ); } -//----------------------------------------------------------------------------- - -// Helper routine. Take an input pointer, return closest -// pointer that is aligned on a DWORD (4 byte) boundary. - -LPWORD lpwAlign( LPWORD lpIn ) -{ - HB_PTRDIFF ul = ( HB_PTRDIFF ) lpIn; - ul += 3; - ul >>=2; - ul <<=2; - return ( LPWORD ) ul; -} - -//----------------------------------------------------------------------------- - - -int nCopyAnsiToWideChar (LPWORD lpWCStr, LPSTR lpAnsiIn) -{ - int nChar = 0; - - do { - *lpWCStr++ = (WORD) *lpAnsiIn; - nChar++; - } while (*lpAnsiIn++); - - return nChar; -} - -/* - -alternative to the above function: - -//---------------------------------------------------------------------------- - -// Helper routine. Takes second parameter as Ansi string, copies -// it to first parameter as wide character (16-bits / char) string, -// and returns integer number of wide characters (words) in string -// (including the trailing wide char NULL). - -int nCopyAnsiToWideChar (LPWORD lpWCStr, LPSTR lpAnsiIn) -{ - int cchAnsi = lstrlen( lpAnsiIn ); - return MultiByteToWideChar(GetACP(), MB_PRECOMPOSED, lpAnsiIn, cchAnsi, lpWCStr, cchAnsi) +1; -} - -*/ - // Mutex functions diff --git a/harbour/contrib/hbwhat/wincorec.c b/harbour/contrib/hbwhat/wincorec.c index dd5af30038..6d0d128d05 100644 --- a/harbour/contrib/hbwhat/wincorec.c +++ b/harbour/contrib/hbwhat/wincorec.c @@ -40,8 +40,54 @@ LRESULT CALLBACK __WndProc10 (HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa BOOL CALLBACK __DlgProc( HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); -int nCopyAnsiToWideChar (LPWORD lpWCStr, LPSTR lpAnsiIn); -LPWORD lpwAlign ( LPWORD lpIn); + +//----------------------------------------------------------------------------- + +// Helper routine. Take an input pointer, return closest +// pointer that is aligned on a DWORD (4 byte) boundary. + +static LPWORD lpwAlign( LPWORD lpIn ) +{ + HB_PTRDIFF ul = ( HB_PTRDIFF ) lpIn; + ul += 3; + ul >>=2; + ul <<=2; + return ( LPWORD ) ul; +} + +//----------------------------------------------------------------------------- + + +static int nCopyAnsiToWideChar (LPWORD lpWCStr, LPSTR lpAnsiIn) +{ + int nChar = 0; + + do { + *lpWCStr++ = (WORD) *lpAnsiIn; + nChar++; + } while (*lpAnsiIn++); + + return nChar; +} + +/* + +alternative to the above function: + +//---------------------------------------------------------------------------- + +// Helper routine. Takes second parameter as Ansi string, copies +// it to first parameter as wide character (16-bits / char) string, +// and returns integer number of wide characters (words) in string +// (including the trailing wide char NULL). + +static int nCopyAnsiToWideChar (LPWORD lpWCStr, LPSTR lpAnsiIn) +{ + int cchAnsi = lstrlen( lpAnsiIn ); + return MultiByteToWideChar(GetACP(), MB_PRECOMPOSED, lpAnsiIn, cchAnsi, lpWCStr, cchAnsi) +1; +} + +*/ //----------------------------------------------------------------------------- @@ -613,10 +659,11 @@ HB_FUNC( _MAKEDLGTEMPLATE ) *p++ = (short) 0; // Menu (ignored for now.) *p++ = (short) 0x00; // Class also ignored - if ( hb_parinfa(1,11) == HB_IT_STRING ) { - nchar = nCopyAnsiToWideChar( p, TEXT( hb_parc(1,11) ) ); - p += nchar ; - } + if ( hb_parinfa(1,11) == HB_IT_STRING ) + { + nchar = nCopyAnsiToWideChar( p, ( LPSTR ) hb_parc(1,11) ); + p += nchar; + } else *p++ =0 ; @@ -627,7 +674,7 @@ HB_FUNC( _MAKEDLGTEMPLATE ) *p++ = (short) hb_parni(1,13); *p++ = (short) hb_parni(1,14); - nchar = nCopyAnsiToWideChar( p, TEXT( hb_parc(1,15) ) ); + nchar = nCopyAnsiToWideChar( p, ( LPSTR ) hb_parc(1,15) ); p += nchar ; } ; @@ -658,25 +705,27 @@ HB_FUNC( _MAKEDLGTEMPLATE ) *p++ = LOWORD ( hb_parnl(9,i) ); // id *p++ = HIWORD ( hb_parnl(9,i) ); // id // 0; - if ( hb_parinfa(10,i) == HB_IT_STRING ) { - nchar = nCopyAnsiToWideChar(p, TEXT ( hb_parc(10,i)) ); // class - p += nchar ; - } + if( hb_parinfa(10,i) == HB_IT_STRING ) + { + nchar = nCopyAnsiToWideChar(p, ( LPSTR ) hb_parc(10,i) ); // class + p += nchar; + } else - { - *p++ = 0xFFFF ; + { + *p++ = 0xFFFF; *p++ = (WORD) hb_parni(10,i); - } + } - if ( hb_parinfa(11,i) == HB_IT_STRING ) { - nchar = nCopyAnsiToWideChar(p, (LPSTR) hb_parc(11,i) ); // text - p += nchar ; - } + if ( hb_parinfa(11,i) == HB_IT_STRING ) + { + nchar = nCopyAnsiToWideChar(p, ( LPSTR ) hb_parc(11,i) ); // text + p += nchar; + } else - { + { *p++ = 0xFFFF ; *p++ = (WORD) hb_parni(11,i); - } + } *p++ = 0x00 ; // extras ( in array 12 ) diff --git a/harbour/doc/whatsnew.txt b/harbour/doc/whatsnew.txt index e66ea3d898..193adc6fe6 100644 --- a/harbour/doc/whatsnew.txt +++ b/harbour/doc/whatsnew.txt @@ -208,6 +208,7 @@ Contrib and fixed to support Win64 platform. INTERNETREADFILE(), INTERNETWRITEFILE() functions were fixed. what32.ch renamed to hbwhat.ch. +- hbhpdf fixed HPDF_ADDPAGELABEL(). Known build issues =============================