From 443ac3a1ae7362da61c4b2df9205e064e674bf8f Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Wed, 20 Apr 2011 01:45:35 +0000 Subject: [PATCH] 2011-04-20 03:43 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * utils/hbmk2/hbmk2.prg + new filter values: lngcpp and lngc. Can be used to check forced C++/C mode. * contrib/hbmzip/3rd/minizip/ioapi.h * contrib/hbmzip/3rd/minizip/zip.h * contrib/hbmzip/3rd/minizip/minizip.dif ! C++ -> ANSI C comments * contrib/hbmzip/3rd/minizip/minizip.hbp ! Override c89 mode with gnu89. For f*64() functions. * contrib/rddads/rddads.hbp ! Override c89 mode with gnu89. ADS headers need it. * contrib/hbpre.hbm + Forcing c89 mode for GCC family compilers (in non C++ forced mode) Results were pretty good and Harbour/3rd party code complies very well. * contrib/hbunix/hbunix.hbp * contrib/hbcurl/hbcurl.hbm * contrib/hbnetio/hbnetio.hbp * contrib/gtwvg/gtwvg.hbp * contrib/hbwin/hbwin.hbp * contrib/hbsqlit3/hbsqlit3.hbp * contrib/hbexpat/hbexpat.hbp * contrib/hbmemio/hbmemio.hbp - Deleted just added local c89 mode forcage. Now it's done global. * contrib/hbqt/qtgui/hbqtgui.h ! Fixed HBQT_TYPE_QIcon redefinintion. Pls check, I didn't rebuild the whole package after the mod. --- harbour/ChangeLog | 39 ++++++++++- harbour/contrib/gtwvg/gtwvg.hbp | 2 - harbour/contrib/hbcurl/hbcurl.hbm | 2 - harbour/contrib/hbexpat/hbexpat.hbp | 2 - harbour/contrib/hbmemio/hbmemio.hbp | 2 - harbour/contrib/hbmzip/3rd/minizip/ioapi.h | 4 +- .../contrib/hbmzip/3rd/minizip/minizip.dif | 64 +++++++++++++------ .../contrib/hbmzip/3rd/minizip/minizip.hbp | 3 + harbour/contrib/hbmzip/3rd/minizip/zip.h | 2 +- harbour/contrib/hbnetio/hbnetio.hbp | 2 - harbour/contrib/hbpre.hbm | 2 + harbour/contrib/hbqt/qtgui/hbqtgui.h | 4 +- harbour/contrib/hbsqlit3/hbsqlit3.hbp | 2 - harbour/contrib/hbunix/hbunix.hbp | 2 - harbour/contrib/hbwin/hbwin.hbp | 2 - harbour/contrib/rddads/rddads.hbp | 3 + harbour/utils/hbmk2/hbmk2.prg | 2 + 17 files changed, 98 insertions(+), 41 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index dc1faa9b09..8fffab2680 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,11 +16,45 @@ The license applies to all entries newer than 2009-04-28. */ +2011-04-20 03:43 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) + * utils/hbmk2/hbmk2.prg + + new filter values: lngcpp and lngc. Can be used to + check forced C++/C mode. + + * contrib/hbmzip/3rd/minizip/ioapi.h + * contrib/hbmzip/3rd/minizip/zip.h + * contrib/hbmzip/3rd/minizip/minizip.dif + ! C++ -> ANSI C comments + + * contrib/hbmzip/3rd/minizip/minizip.hbp + ! Override c89 mode with gnu89. For f*64() functions. + + * contrib/rddads/rddads.hbp + ! Override c89 mode with gnu89. ADS headers need it. + + * contrib/hbpre.hbm + + Forcing c89 mode for GCC family compilers (in non C++ forced mode) + Results were pretty good and Harbour/3rd party code complies + very well. + + * contrib/hbunix/hbunix.hbp + * contrib/hbcurl/hbcurl.hbm + * contrib/hbnetio/hbnetio.hbp + * contrib/gtwvg/gtwvg.hbp + * contrib/hbwin/hbwin.hbp + * contrib/hbsqlit3/hbsqlit3.hbp + * contrib/hbexpat/hbexpat.hbp + * contrib/hbmemio/hbmemio.hbp + - Deleted just added local c89 mode forcage. Now it's done global. + + * contrib/hbqt/qtgui/hbqtgui.h + ! Fixed HBQT_TYPE_QIcon redefinintion. Pls check, I didn't rebuild the + whole package after the mod. + 2011-04-20 02:19 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * contrib/hbunix/hbunix.hbp * contrib/hbcurl/hbcurl.hbm * contrib/hbnetio/hbnetio.hbp - * contrib/hbnetio/hbnetio.hbx * contrib/gtwvg/gtwvg.hbp * contrib/hbwin/hbwin.hbp * contrib/hbsqlit3/hbsqlit3.hbp @@ -41,6 +75,9 @@ ../../../hbprintf.c:543:4: warning: implicit declaration of function 'modfl' ../../../hbprintf.c:1146:25: warning: implicit declaration of function 'isfinite' + * contrib/hbnetio/hbnetio.hbx + * autoupdated. + * contrib/hbqt/qtgui/hbqt_hbqsyntaxhighlighter.cpp * contrib/hbqt/qtgui/hbqt_hbqplaintextedit.cpp * contrib/hbqt/qtgui/hbqt_hbqgraphicsscene.cpp diff --git a/harbour/contrib/gtwvg/gtwvg.hbp b/harbour/contrib/gtwvg/gtwvg.hbp index 584db7761c..cacef65a0d 100644 --- a/harbour/contrib/gtwvg/gtwvg.hbp +++ b/harbour/contrib/gtwvg/gtwvg.hbp @@ -16,8 +16,6 @@ # Optimize build time and make sure we build even with this option -cflag=-DWIN32_LEAN_AND_MEAN --cflag=-std=c89{allgcc} - -instfile=inc:hbgtwvg.ch -instfile=inc:wvtwin.ch -instfile=inc:wvgparts.ch diff --git a/harbour/contrib/hbcurl/hbcurl.hbm b/harbour/contrib/hbcurl/hbcurl.hbm index 6abfbd6283..6573322897 100644 --- a/harbour/contrib/hbcurl/hbcurl.hbm +++ b/harbour/contrib/hbcurl/hbcurl.hbm @@ -10,8 +10,6 @@ -w3 -es2 --cflag=-std=c89{allgcc} - -depkeyhead=curl:curl/curl.h -depcontrol=curl:no{HB_BUILD_3RDEXT='no'} -depcontrol=curl:${HB_WITH_CURL} diff --git a/harbour/contrib/hbexpat/hbexpat.hbp b/harbour/contrib/hbexpat/hbexpat.hbp index b536567544..7782e01b06 100644 --- a/harbour/contrib/hbexpat/hbexpat.hbp +++ b/harbour/contrib/hbexpat/hbexpat.hbp @@ -9,8 +9,6 @@ -w3 -es2 --cflag=-std=c89{allgcc} - -depkeyhead=expat:expat.h -depcontrol=expat:local{HB_BUILD_3RDEXT='no'} -depcontrol=expat:${HB_WITH_EXPAT} diff --git a/harbour/contrib/hbmemio/hbmemio.hbp b/harbour/contrib/hbmemio/hbmemio.hbp index d2029a1c9f..2b8f4b0dea 100644 --- a/harbour/contrib/hbmemio/hbmemio.hbp +++ b/harbour/contrib/hbmemio/hbmemio.hbp @@ -9,8 +9,6 @@ -w3 -es2 --cflag=-std=c89{allgcc} - -instfile=inc:hbmemio.hbx hbmemio.hbx diff --git a/harbour/contrib/hbmzip/3rd/minizip/ioapi.h b/harbour/contrib/hbmzip/3rd/minizip/ioapi.h index b8a1aef3ed..3b67b22cd4 100644 --- a/harbour/contrib/hbmzip/3rd/minizip/ioapi.h +++ b/harbour/contrib/hbmzip/3rd/minizip/ioapi.h @@ -207,8 +207,8 @@ typedef struct zlib_filefunc64_32_def_s #define ZREAD64(filefunc,filestream,buf,size) ((*((filefunc).zfile_func64.zread_file)) ((filefunc).zfile_func64.opaque,filestream,buf,size)) #define ZWRITE64(filefunc,filestream,buf,size) ((*((filefunc).zfile_func64.zwrite_file)) ((filefunc).zfile_func64.opaque,filestream,buf,size)) -//#define ZTELL64(filefunc,filestream) ((*((filefunc).ztell64_file)) ((filefunc).opaque,filestream)) -//#define ZSEEK64(filefunc,filestream,pos,mode) ((*((filefunc).zseek64_file)) ((filefunc).opaque,filestream,pos,mode)) +/*#define ZTELL64(filefunc,filestream) ((*((filefunc).ztell64_file)) ((filefunc).opaque,filestream))*/ +/*#define ZSEEK64(filefunc,filestream,pos,mode) ((*((filefunc).zseek64_file)) ((filefunc).opaque,filestream,pos,mode))*/ #define ZCLOSE64(filefunc,filestream) ((*((filefunc).zfile_func64.zclose_file)) ((filefunc).zfile_func64.opaque,filestream)) #define ZERROR64(filefunc,filestream) ((*((filefunc).zfile_func64.zerror_file)) ((filefunc).zfile_func64.opaque,filestream)) diff --git a/harbour/contrib/hbmzip/3rd/minizip/minizip.dif b/harbour/contrib/hbmzip/3rd/minizip/minizip.dif index a28a0e5307..c130feec4a 100644 --- a/harbour/contrib/hbmzip/3rd/minizip/minizip.dif +++ b/harbour/contrib/hbmzip/3rd/minizip/minizip.dif @@ -1,6 +1,6 @@ -diff -urN minizip.orig/crypt.h minizip/crypt.h ---- minizip.orig/crypt.h 2011-04-19 15:58:45.649571580 +0200 -+++ minizip/crypt.h 2011-04-19 15:58:45.649571580 +0200 +diff -urN minizip.orig\crypt.h minizip\crypt.h +--- minizip.orig\crypt.h Wed Apr 20 03:26:49 2011 ++++ minizip\crypt.h Wed Apr 20 03:26:49 2011 @@ -38,6 +38,8 @@ * unpredictable manner on 16-bit systems; not a problem * with any known compiler so far, though */ @@ -10,9 +10,9 @@ diff -urN minizip.orig/crypt.h minizip/crypt.h temp = ((unsigned)(*(pkeys+2)) & 0xffff) | 2; return (int)(((temp * (temp ^ 1)) >> 8) & 0xff); } -diff -urN minizip.orig/ioapi.c minizip/ioapi.c ---- minizip.orig/ioapi.c 2011-04-19 15:58:45.651571109 +0200 -+++ minizip/ioapi.c 2011-04-19 15:58:45.651571109 +0200 +diff -urN minizip.orig\ioapi.c minizip\ioapi.c +--- minizip.orig\ioapi.c Wed Apr 20 03:26:49 2011 ++++ minizip\ioapi.c Wed Apr 20 03:26:49 2011 @@ -15,6 +15,7 @@ #endif @@ -142,19 +142,15 @@ diff -urN minizip.orig/ioapi.c minizip/ioapi.c { pzlib_filefunc_def->zopen_file = fopen_file_func; pzlib_filefunc_def->zread_file = fread_file_func; -diff -urN minizip.orig/ioapi.h minizip/ioapi.h ---- minizip.orig/ioapi.h 2011-04-19 15:58:45.652571415 +0200 -+++ minizip/ioapi.h 2011-04-19 15:58:45.652571415 +0200 +diff -urN minizip.orig\ioapi.h minizip\ioapi.h +--- minizip.orig\ioapi.h Wed Apr 20 03:26:49 2011 ++++ minizip\ioapi.h Wed Apr 20 03:26:49 2011 @@ -21,29 +21,58 @@ #ifndef _ZLIBIOAPI64_H #define _ZLIBIOAPI64_H -#if (!defined(_WIN32)) && (!defined(WIN32)) -+#if !(defined(_WIN32) || defined(WIN32)) && \ -+ !(defined(__MSDOS__) || defined(MSDOS)) && \ -+ !(defined(OS_2) || defined(__OS2__) || defined(OS2)) && \ -+ !defined(__WATCOMC__) - +- - // Linux needs this to support file operation on files larger then 4+GB - // But might need better if/def to select just the platforms that needs them. - @@ -170,6 +166,11 @@ diff -urN minizip.orig/ioapi.h minizip/ioapi.h - #ifndef _FILE_OFFSET_BIT - #define _FILE_OFFSET_BIT 64 - #endif ++#if !(defined(_WIN32) || defined(WIN32)) && \ ++ !(defined(__MSDOS__) || defined(MSDOS)) && \ ++ !(defined(OS_2) || defined(__OS2__) || defined(OS2)) && \ ++ !defined(__WATCOMC__) ++ + /* Linux needs this to support file operation on files larger then 4+GB + * on 32bit platforms + * But might need better if/def to select just the platforms that needs them. @@ -220,9 +221,20 @@ diff -urN minizip.orig/ioapi.h minizip/ioapi.h #if defined(USE_FILE32API) #define fopen64 fopen #define ftello64 ftell -diff -urN minizip.orig/unzip.c minizip/unzip.c ---- minizip.orig/unzip.c 2011-04-19 15:58:45.667570882 +0200 -+++ minizip/unzip.c 2011-04-19 15:58:45.668569995 +0200 +@@ -178,8 +207,8 @@ + + #define ZREAD64(filefunc,filestream,buf,size) ((*((filefunc).zfile_func64.zread_file)) ((filefunc).zfile_func64.opaque,filestream,buf,size)) + #define ZWRITE64(filefunc,filestream,buf,size) ((*((filefunc).zfile_func64.zwrite_file)) ((filefunc).zfile_func64.opaque,filestream,buf,size)) +-//#define ZTELL64(filefunc,filestream) ((*((filefunc).ztell64_file)) ((filefunc).opaque,filestream)) +-//#define ZSEEK64(filefunc,filestream,pos,mode) ((*((filefunc).zseek64_file)) ((filefunc).opaque,filestream,pos,mode)) ++/*#define ZTELL64(filefunc,filestream) ((*((filefunc).ztell64_file)) ((filefunc).opaque,filestream))*/ ++/*#define ZSEEK64(filefunc,filestream,pos,mode) ((*((filefunc).zseek64_file)) ((filefunc).opaque,filestream,pos,mode))*/ + #define ZCLOSE64(filefunc,filestream) ((*((filefunc).zfile_func64.zclose_file)) ((filefunc).zfile_func64.opaque,filestream)) + #define ZERROR64(filefunc,filestream) ((*((filefunc).zfile_func64.zerror_file)) ((filefunc).zfile_func64.opaque,filestream)) + +diff -urN minizip.orig\unzip.c minizip\unzip.c +--- minizip.orig\unzip.c Wed Apr 20 03:26:49 2011 ++++ minizip\unzip.c Wed Apr 20 03:26:49 2011 @@ -68,13 +68,17 @@ #include #include @@ -309,9 +321,9 @@ diff -urN minizip.orig/unzip.c minizip/unzip.c pfile_in_zip_read_info->crc32_wait=s->cur_file_info.crc; pfile_in_zip_read_info->crc32=0; -diff -urN minizip.orig/zip.c minizip/zip.c ---- minizip.orig/zip.c 2011-04-19 15:58:45.685570830 +0200 -+++ minizip/zip.c 2011-04-19 15:58:45.686568570 +0200 +diff -urN minizip.orig\zip.c minizip\zip.c +--- minizip.orig\zip.c Wed Apr 20 03:26:49 2011 ++++ minizip\zip.c Wed Apr 20 03:26:49 2011 @@ -29,16 +29,20 @@ #include "zlib.h" #include "zip.h" @@ -507,3 +519,15 @@ diff -urN minizip.orig/zip.c minizip/zip.c if(pData == NULL || *dataLen < 4) return ZIP_PARAMERROR; +diff -urN minizip.orig\zip.h minizip\zip.h +--- minizip.orig\zip.h Wed Apr 20 03:26:49 2011 ++++ minizip\zip.h Wed Apr 20 03:26:49 2011 +@@ -44,7 +44,7 @@ + extern "C" { + #endif + +-//#define HAVE_BZIP2 ++/*#define HAVE_BZIP2*/ + + #ifndef _ZLIB_H + #include "zlib.h" diff --git a/harbour/contrib/hbmzip/3rd/minizip/minizip.hbp b/harbour/contrib/hbmzip/3rd/minizip/minizip.hbp index 550f7bc0f7..ab32dd7ab9 100644 --- a/harbour/contrib/hbmzip/3rd/minizip/minizip.hbp +++ b/harbour/contrib/hbmzip/3rd/minizip/minizip.hbp @@ -13,6 +13,9 @@ -cpp=no -pic +# for f*64() functions +-cflag=-std=gnu89{!lngcpp&allgcc} + ioapi.c zip.c unzip.c diff --git a/harbour/contrib/hbmzip/3rd/minizip/zip.h b/harbour/contrib/hbmzip/3rd/minizip/zip.h index 8aaebb6234..38558e8479 100644 --- a/harbour/contrib/hbmzip/3rd/minizip/zip.h +++ b/harbour/contrib/hbmzip/3rd/minizip/zip.h @@ -44,7 +44,7 @@ extern "C" { #endif -//#define HAVE_BZIP2 +/*#define HAVE_BZIP2*/ #ifndef _ZLIB_H #include "zlib.h" diff --git a/harbour/contrib/hbnetio/hbnetio.hbp b/harbour/contrib/hbnetio/hbnetio.hbp index a7b3082ecc..99dc8f3898 100644 --- a/harbour/contrib/hbnetio/hbnetio.hbp +++ b/harbour/contrib/hbnetio/hbnetio.hbp @@ -9,8 +9,6 @@ -w3 -es2 --cflag=-std=c89{allgcc} - -instfile=inc:hbnetio.hbx hbnetio.hbx diff --git a/harbour/contrib/hbpre.hbm b/harbour/contrib/hbpre.hbm index 46b8e2f51f..1c925d817b 100644 --- a/harbour/contrib/hbpre.hbm +++ b/harbour/contrib/hbpre.hbm @@ -17,4 +17,6 @@ {_HB_BUILD_LIBDYN}-hbdyn +-cflag=-std=c89{!lngcpp&allgcc} + -warn=yes diff --git a/harbour/contrib/hbqt/qtgui/hbqtgui.h b/harbour/contrib/hbqt/qtgui/hbqtgui.h index 14bf5ef56b..c9ccbe79cb 100644 --- a/harbour/contrib/hbqt/qtgui/hbqtgui.h +++ b/harbour/contrib/hbqt/qtgui/hbqtgui.h @@ -32,13 +32,15 @@ HB_EXTERN_END #define HBQT_TYPE_QBrush ( ( HB_U32 ) 0x94319C70 ) #define HBQT_TYPE_QColor ( ( HB_U32 ) 0x03C0065A ) #define HBQT_TYPE_QFont ( ( HB_U32 ) 0xF6037D8A ) -#define HBQT_TYPE_QIcon ( ( HB_U32 ) 0x43035C83 ) #define HBQT_TYPE_QGradient ( ( HB_U32 ) 0x7F4BEC23 ) #define HBQT_TYPE_QMatrix ( ( HB_U32 ) 0xAA3E35B7 ) #define HBQT_TYPE_QImage ( ( HB_U32 ) 0xA0AB4AEC ) #define HBQT_TYPE_QBitmap ( ( HB_U32 ) 0xBA602AD4 ) #define HBQT_TYPE_QBoxLayout ( ( HB_U32 ) 0xA184A755 ) +#ifndef HBQT_TYPE_QIcon +#define HBQT_TYPE_QIcon ( ( HB_U32 ) 0x43035C83 ) +#endif #ifndef HBQT_TYPE_QPixmap #define HBQT_TYPE_QPixmap ( ( HB_U32 ) 0xBEA836FC ) #endif diff --git a/harbour/contrib/hbsqlit3/hbsqlit3.hbp b/harbour/contrib/hbsqlit3/hbsqlit3.hbp index cca41fa17a..816184193b 100644 --- a/harbour/contrib/hbsqlit3/hbsqlit3.hbp +++ b/harbour/contrib/hbsqlit3/hbsqlit3.hbp @@ -9,8 +9,6 @@ -w3 -es2 --cflag=-std=c89{allgcc} - -depkeyhead=sqlite3:sqlite3.h -depcontrol=sqlite3:local{HB_BUILD_3RDEXT='no'} -depcontrol=sqlite3:${HB_WITH_SQLITE3} diff --git a/harbour/contrib/hbunix/hbunix.hbp b/harbour/contrib/hbunix/hbunix.hbp index 639d66ea6e..c79ddaba3c 100644 --- a/harbour/contrib/hbunix/hbunix.hbp +++ b/harbour/contrib/hbunix/hbunix.hbp @@ -9,8 +9,6 @@ -w3 -es2 --cflag=-std=c89{allgcc} - -stop{!unix} hbunix.hbx diff --git a/harbour/contrib/hbwin/hbwin.hbp b/harbour/contrib/hbwin/hbwin.hbp index 2723728011..bd12ded4ac 100644 --- a/harbour/contrib/hbwin/hbwin.hbp +++ b/harbour/contrib/hbwin/hbwin.hbp @@ -13,8 +13,6 @@ -cflag=-DWIN32_LEAN_AND_MEAN --cflag=-std=c89{allgcc} - -depkeyhead=png:png.h -depcontrol=png:local{HB_BUILD_3RDEXT='no'} -depcontrol=png:${HB_WITH_PNG} diff --git a/harbour/contrib/rddads/rddads.hbp b/harbour/contrib/rddads/rddads.hbp index c954cb870b..72fac85dd0 100644 --- a/harbour/contrib/rddads/rddads.hbp +++ b/harbour/contrib/rddads/rddads.hbp @@ -9,6 +9,9 @@ -w3 -es2 +# for ADS headers +-cflag=-std=gnu89{!lngcpp&allgcc} + -stop{!(linux|win)} -depkeyhead=ads:ace.h diff --git a/harbour/utils/hbmk2/hbmk2.prg b/harbour/utils/hbmk2/hbmk2.prg index 070ba3f589..beda34867a 100644 --- a/harbour/utils/hbmk2/hbmk2.prg +++ b/harbour/utils/hbmk2/hbmk2.prg @@ -11028,6 +11028,8 @@ FUNCTION hbmk_KEYW( hbmk, cKeyword, cValue, cOperator ) CASE "nodebug" ; RETURN ! hbmk[ _HBMK_lDEBUG ] CASE "shared" ; RETURN hbmk[ _HBMK_lSHARED ] CASE "static" ; RETURN ! hbmk[ _HBMK_lSHARED ] + CASE "lngcpp" ; RETURN hbmk[ _HBMK_lCPP ] != NIL .AND. hbmk[ _HBMK_lCPP ] + CASE "lngc" ; RETURN hbmk[ _HBMK_lCPP ] != NIL .AND. ! hbmk[ _HBMK_lCPP ] CASE "winuni" ; RETURN hbmk[ _HBMK_lWINUNI ] CASE "winansi" ; RETURN ! hbmk[ _HBMK_lWINUNI ] CASE "unix" ; RETURN HBMK_ISPLAT( "bsd|hpux|sunos|beos|qnx|android|vxworks|symbian|linux|darwin|cygwin|minix" )