From 8cf8de75c0a31cc2fae865b472f579227bdcc7b4 Mon Sep 17 00:00:00 2001 From: Przemyslaw Czerpak Date: Sun, 9 Sep 2012 16:51:37 +0000 Subject: [PATCH] 2012-09-09 18:50 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl) * harbour/config/dos/watcom.mk * harbour/utils/hbmk2/hbmk2.prg ! cleaned and synced optimization flags which interacts with calling convention * harbour/src/3rd/zlib/zconf.h ! added missing export attribute in OS2 dll builds * harbour/src/3rd/zlib/zlib.dif * rediffed * harbour/src/compiler/hbmain.c * minor modification to pacify warning generated by some compilers * harbour/src/rtl/gete.c ! added missing #include "hbapicdp.h" in DOS and OS2 builds * harbour/src/rtl/gtdos/gtdos.c ! fixed typo * harbour/contrib/3rd/sqlite3/sqlite3.hbp ! set SQLITE_OS_OTHER in Watcom OS2 builds - it does not support PTHREAD and some OS extensions used in default SQLite builds --- harbour/ChangeLog | 25 +++++++++ harbour/config/dos/watcom.mk | 2 + harbour/contrib/3rd/sqlite3/sqlite3.hbp | 2 + harbour/src/3rd/zlib/zconf.h | 10 ++++ harbour/src/3rd/zlib/zlib.dif | 71 +++++++++++++++---------- harbour/src/compiler/hbmain.c | 6 ++- harbour/src/rtl/gete.c | 1 + harbour/src/rtl/gtdos/gtdos.c | 2 +- harbour/utils/hbmk2/hbmk2.prg | 2 + 9 files changed, 91 insertions(+), 30 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 4f2f6e239b..c15a1a543d 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,31 @@ The license applies to all entries newer than 2009-04-28. */ +2012-09-09 18:50 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl) + * harbour/config/dos/watcom.mk + * harbour/utils/hbmk2/hbmk2.prg + ! cleaned and synced optimization flags which interacts with calling + convention + + * harbour/src/3rd/zlib/zconf.h + ! added missing export attribute in OS2 dll builds + + * harbour/src/3rd/zlib/zlib.dif + * rediffed + + * harbour/src/compiler/hbmain.c + * minor modification to pacify warning generated by some compilers + + * harbour/src/rtl/gete.c + ! added missing #include "hbapicdp.h" in DOS and OS2 builds + + * harbour/src/rtl/gtdos/gtdos.c + ! fixed typo + + * harbour/contrib/3rd/sqlite3/sqlite3.hbp + ! set SQLITE_OS_OTHER in Watcom OS2 builds - it does not support + PTHREAD and some OS extensions used in default SQLite builds + 2012-09-09 14:02 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl) * harbour/src/rdd/workarea.c ! set FOUND flag in child workareas when non index but diff --git a/harbour/config/dos/watcom.mk b/harbour/config/dos/watcom.mk index 121ccbc1bc..ddf43773d9 100644 --- a/harbour/config/dos/watcom.mk +++ b/harbour/config/dos/watcom.mk @@ -43,6 +43,8 @@ ifneq ($(HB_BUILD_OPTIM),no) else CFLAGS += -oi endif +else + CFLAGS += -3r endif CFLAGS += -i. -i$(HB_HOST_INC) diff --git a/harbour/contrib/3rd/sqlite3/sqlite3.hbp b/harbour/contrib/3rd/sqlite3/sqlite3.hbp index c784b856a6..1041e448a1 100644 --- a/harbour/contrib/3rd/sqlite3/sqlite3.hbp +++ b/harbour/contrib/3rd/sqlite3/sqlite3.hbp @@ -33,6 +33,8 @@ -cflag=-DSQLITE_OS_OTHER{dos} # Watcom Linux builds cannot use system header files -cflag=-DSQLITE_OS_OTHER{linux&watcom} +# Watcom OS2 builds do not support pthreads and some other system headers +-cflag=-DSQLITE_OS_OTHER{os2&watcom} -cflag=-DSQLITE_THREADSAFE=0{minix} -cflag=-DSQLITE_OMIT_LOAD_EXTENSION=1{minix} diff --git a/harbour/src/3rd/zlib/zconf.h b/harbour/src/3rd/zlib/zconf.h index 6053b604c2..91f60e62cc 100644 --- a/harbour/src/3rd/zlib/zconf.h +++ b/harbour/src/3rd/zlib/zconf.h @@ -358,6 +358,16 @@ # endif #endif +#if defined(OS2) && defined(__WATCOMC__) +# ifdef ZLIB_DLL +# ifdef ZLIB_INTERNAL +# define ZEXTERN extern __declspec(dllexport) +# else +# define ZEXPORT extern __declspec(dllimport) +# endif +# endif +#endif + #ifndef ZEXTERN # define ZEXTERN extern #endif diff --git a/harbour/src/3rd/zlib/zlib.dif b/harbour/src/3rd/zlib/zlib.dif index a6f7e38de9..9295a93381 100644 --- a/harbour/src/3rd/zlib/zlib.dif +++ b/harbour/src/3rd/zlib/zlib.dif @@ -1,6 +1,6 @@ -diff -urN zlib.orig\crc32.c zlib\crc32.c ---- zlib.orig\crc32.c Mon Jun 04 15:11:07 2012 -+++ zlib\crc32.c Mon Jun 04 15:11:07 2012 +diff -urN zlib.orig/crc32.c zlib/crc32.c +--- zlib.orig/crc32.c 2012-09-09 18:31:49.628000777 +0200 ++++ zlib/crc32.c 2012-09-09 18:31:49.628000777 +0200 @@ -21,6 +21,8 @@ DYNAMIC_CRC_TABLE and MAKECRCH can be #defined to write out crc32.h. */ @@ -10,9 +10,9 @@ diff -urN zlib.orig\crc32.c zlib\crc32.c #ifdef MAKECRCH # include # ifndef DYNAMIC_CRC_TABLE -diff -urN zlib.orig\deflate.c zlib\deflate.c ---- zlib.orig\deflate.c Mon Jun 04 15:11:07 2012 -+++ zlib\deflate.c Mon Jun 04 15:11:07 2012 +diff -urN zlib.orig/deflate.c zlib/deflate.c +--- zlib.orig/deflate.c 2012-09-09 18:31:49.636000776 +0200 ++++ zlib/deflate.c 2012-09-09 18:31:49.636000776 +0200 @@ -51,6 +51,10 @@ #include "deflate.h" @@ -49,9 +49,9 @@ diff -urN zlib.orig\deflate.c zlib\deflate.c Bytef *scan, *strend; /* scan goes up to strend for length of run */ for (;;) { -diff -urN zlib.orig\gzguts.h zlib\gzguts.h ---- zlib.orig\gzguts.h Mon Jun 04 15:11:07 2012 -+++ zlib\gzguts.h Mon Jun 04 15:11:07 2012 +diff -urN zlib.orig/gzguts.h zlib/gzguts.h +--- zlib.orig/gzguts.h 2012-09-09 18:31:49.636000776 +0200 ++++ zlib/gzguts.h 2012-09-09 18:31:49.636000776 +0200 @@ -31,7 +31,8 @@ # include #endif @@ -72,9 +72,9 @@ diff -urN zlib.orig\gzguts.h zlib\gzguts.h # ifndef HAVE_VSNPRINTF # define HAVE_VSNPRINTF # endif -diff -urN zlib.orig\gzlib.c zlib\gzlib.c ---- zlib.orig\gzlib.c Mon Jun 04 15:11:07 2012 -+++ zlib\gzlib.c Mon Jun 04 15:11:07 2012 +diff -urN zlib.orig/gzlib.c zlib/gzlib.c +--- zlib.orig/gzlib.c 2012-09-09 18:31:49.640000776 +0200 ++++ zlib/gzlib.c 2012-09-09 18:31:49.640000776 +0200 @@ -5,7 +5,11 @@ #include "gzguts.h" @@ -88,9 +88,9 @@ diff -urN zlib.orig\gzlib.c zlib\gzlib.c # define LSEEK _lseeki64 #else #if defined(_LARGEFILE64_SOURCE) && _LFS64_LARGEFILE-0 -diff -urN zlib.orig\inflate.c zlib\inflate.c ---- zlib.orig\inflate.c Mon Jun 04 15:11:07 2012 -+++ zlib\inflate.c Mon Jun 04 15:11:07 2012 +diff -urN zlib.orig/inflate.c zlib/inflate.c +--- zlib.orig/inflate.c 2012-09-09 18:31:49.648000777 +0200 ++++ zlib/inflate.c 2012-09-09 18:31:49.648000777 +0200 @@ -428,6 +428,7 @@ /* Macros for inflate(): */ @@ -99,9 +99,9 @@ diff -urN zlib.orig\inflate.c zlib\inflate.c #ifdef GUNZIP # define UPDATE(check, buf, len) \ (state->flags ? crc32(check, buf, len) : adler32(check, buf, len)) -diff -urN zlib.orig\zconf.h zlib\zconf.h ---- zlib.orig\zconf.h Mon Jun 04 15:11:07 2012 -+++ zlib\zconf.h Mon Jun 04 15:11:07 2012 +diff -urN zlib.orig/zconf.h zlib/zconf.h +--- zlib.orig/zconf.h 2012-09-09 18:31:49.656000777 +0200 ++++ zlib/zconf.h 2012-09-09 18:31:49.656000777 +0200 @@ -158,7 +158,18 @@ #if defined(_WINDOWS) && !defined(WINDOWS) # define WINDOWS @@ -122,9 +122,26 @@ diff -urN zlib.orig\zconf.h zlib\zconf.h # ifndef WIN32 # define WIN32 # endif -diff -urN zlib.orig\zlib.h zlib\zlib.h ---- zlib.orig\zlib.h Mon Jun 04 15:11:07 2012 -+++ zlib\zlib.h Mon Jun 04 15:11:07 2012 +@@ -346,6 +357,16 @@ + # endif + # endif + #endif ++ ++#if defined(OS2) && defined(__WATCOMC__) ++# ifdef ZLIB_DLL ++# ifdef ZLIB_INTERNAL ++# define ZEXTERN extern __declspec(dllexport) ++# else ++# define ZEXPORT extern __declspec(dllimport) ++# endif ++# endif ++#endif + + #ifndef ZEXTERN + # define ZEXTERN extern +diff -urN zlib.orig/zlib.h zlib/zlib.h +--- zlib.orig/zlib.h 2012-09-09 18:31:49.660000777 +0200 ++++ zlib/zlib.h 2012-09-09 18:31:49.660000777 +0200 @@ -1711,6 +1711,8 @@ ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile)); ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t)); @@ -134,9 +151,9 @@ diff -urN zlib.orig\zlib.h zlib\zlib.h #endif #else /* Z_SOLO */ -diff -urN zlib.orig\zutil.c zlib\zutil.c ---- zlib.orig\zutil.c Mon Jun 04 15:11:07 2012 -+++ zlib\zutil.c Mon Jun 04 15:11:07 2012 +diff -urN zlib.orig/zutil.c zlib/zutil.c +--- zlib.orig/zutil.c 2012-09-09 18:31:49.660000777 +0200 ++++ zlib/zutil.c 2012-09-09 18:31:49.660000777 +0200 @@ -139,7 +139,7 @@ return ERR_MSG(err); } @@ -146,9 +163,9 @@ diff -urN zlib.orig\zutil.c zlib\zutil.c /* The Microsoft C Run-Time Library for Windows CE doesn't have * errno. We define it as a global variable to simplify porting. * Its value is always 0 and should not be used. -diff -urN zlib.orig\zutil.h zlib\zutil.h ---- zlib.orig\zutil.h Mon Jun 04 15:11:07 2012 -+++ zlib\zutil.h Mon Jun 04 15:11:07 2012 +diff -urN zlib.orig/zutil.h zlib/zutil.h +--- zlib.orig/zutil.h 2012-09-09 18:31:49.664000777 +0200 ++++ zlib/zutil.h 2012-09-09 18:31:49.664000777 +0200 @@ -22,7 +22,7 @@ #include "zlib.h" diff --git a/harbour/src/compiler/hbmain.c b/harbour/src/compiler/hbmain.c index 5df16fa8b2..95d73780df 100644 --- a/harbour/src/compiler/hbmain.c +++ b/harbour/src/compiler/hbmain.c @@ -2940,7 +2940,8 @@ void hb_compGenPushFunCall( const char * szFunName, int iFlags, HB_COMP_DECL ) HB_SYMBOL_UNUSED( iFlags ); - if( !( pSym = hb_compSymbolFind( HB_COMP_PARAM, szFunName, &wSym, HB_SYM_FUNCNAME ) ) ) + pSym = hb_compSymbolFind( HB_COMP_PARAM, szFunName, &wSym, HB_SYM_FUNCNAME ); + if( !pSym ) pSym = hb_compSymbolAdd( HB_COMP_PARAM, szFunName, &wSym, HB_SYM_FUNCNAME ); pSym->cScope |= HB_FS_USED; @@ -2965,7 +2966,8 @@ void hb_compGenPushSymbol( const char * szSymbolName, HB_BOOL bFunction, HB_COMP PCOMSYMBOL pSym; HB_USHORT wSym; - if( !( pSym = hb_compSymbolFind( HB_COMP_PARAM, szSymbolName, &wSym, bFunction ) ) ) + pSym = hb_compSymbolFind( HB_COMP_PARAM, szSymbolName, &wSym, bFunction ); + if( !pSym ) pSym = hb_compSymbolAdd( HB_COMP_PARAM, szSymbolName, &wSym, bFunction ); if( bFunction ) diff --git a/harbour/src/rtl/gete.c b/harbour/src/rtl/gete.c index 91ab3298d5..379515e96e 100644 --- a/harbour/src/rtl/gete.c +++ b/harbour/src/rtl/gete.c @@ -67,6 +67,7 @@ /* NOTE: Convert the envvar name to uppercase. This is required for DOS and OS/2 systems. [vszakats] */ #if defined( HB_OS_DOS ) || defined( HB_OS_OS2 ) +# include "hbapicdp.h" # define _HB_GETENV_REQUIRES_UPPERCASE #endif diff --git a/harbour/src/rtl/gtdos/gtdos.c b/harbour/src/rtl/gtdos/gtdos.c index 24cf3b928e..7db1eccff0 100644 --- a/harbour/src/rtl/gtdos/gtdos.c +++ b/harbour/src/rtl/gtdos/gtdos.c @@ -1266,7 +1266,7 @@ static void hb_gt_dos_Redraw( PHB_GT pGT, int iRow, int iCol, int iSize ) while( iLen < iSize ) { - if( !HB_GTSELF_GETSCRUC( pGT, iRow, iCol + iLen, &iColor, &bAttr, &uc, HB_TRUE ) + if( !HB_GTSELF_GETSCRUC( pGT, iRow, iCol + iLen, &iColor, &bAttr, &uc, HB_TRUE ) ) break; #if defined( __DJGPP__TEXT ) diff --git a/harbour/utils/hbmk2/hbmk2.prg b/harbour/utils/hbmk2/hbmk2.prg index a68d0474e4..5f6893a9ff 100644 --- a/harbour/utils/hbmk2/hbmk2.prg +++ b/harbour/utils/hbmk2/hbmk2.prg @@ -4308,6 +4308,8 @@ FUNCTION hbmk( aArgs, nArgTarget, /* @ */ lPause, nLevel ) ELSE IF hbmk[ _HBMK_cPLAT ] == "win" cOpt_CompC += " -3s" + ELSEIF HBMK_ISPLAT( "dos|os2|linux" ) + cOpt_CompC += " -3r" ENDIF ENDIF SWITCH hbmk[ _HBMK_nWARN ]