From 89930d14da8d4f5521271bc88a322bd31fc03a9c Mon Sep 17 00:00:00 2001 From: Przemyslaw Czerpak Date: Wed, 16 Sep 2009 00:41:09 +0000 Subject: [PATCH] 2009-09-16 02:40 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/include/hbvmpub.h * harbour/include/hbdefs.h * added #if/#endif comments and minor formatting * harbour/include/hbsetup.h ! disable malloc attribute for GCC < 3.xx * harbour/include/hbinit.h ! removed unnecessary __HAIKU__ condition * harbour/include/hbdate.h ! enable MT safe localtime_r() function in HAIKU/BEOS builds * harbour/source/common/hbgete.c ! enable setenv()/unsetenv() in HAIKU/BEOS builds * harbour/source/common/hbprintf.c ! removed wrongly added condition which disabled [u]intmax_t for GCC < 3 * harbour/source/rtl/gtcrs/gtcrs.h ! do not redefine existing MAX_SIGNO * harbour/source/rtl/hbsocket.c ! enabled MT safe socket functions in HAIKU/BEOS builds * harbour/config/beos/libs.mk ! do not set explicitly GCC internal library paths. They are configured in GCC config and should not be overloaded in normal builds. TOFIX: error code are not properly decoded in HAIKU/BEOS builds. It can be seen in hbtest results. It's possible that it's HAIKU/BEOS problem not Harbour one. --- harbour/ChangeLog | 35 ++++++++++++++++++++++++++++++++ harbour/config/beos/libs.mk | 2 +- harbour/include/hbdate.h | 2 +- harbour/include/hbdefs.h | 3 ++- harbour/include/hbinit.h | 3 +-- harbour/include/hbsetup.h | 6 +++++- harbour/include/hbvmpub.h | 10 ++++----- harbour/source/common/hbgete.c | 3 ++- harbour/source/common/hbprintf.c | 3 +-- harbour/source/rtl/gtcrs/gtcrs.h | 4 +++- harbour/source/rtl/hbsocket.c | 8 +++++--- 11 files changed, 61 insertions(+), 18 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 0f7bcbf3d0..a1c78a1cf5 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,41 @@ past entries belonging to author(s): Viktor Szakats. */ +2009-09-16 02:40 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) + * harbour/include/hbvmpub.h + * harbour/include/hbdefs.h + * added #if/#endif comments and minor formatting + + * harbour/include/hbsetup.h + ! disable malloc attribute for GCC < 3.xx + + * harbour/include/hbinit.h + ! removed unnecessary __HAIKU__ condition + + * harbour/include/hbdate.h + ! enable MT safe localtime_r() function in HAIKU/BEOS builds + + * harbour/source/common/hbgete.c + ! enable setenv()/unsetenv() in HAIKU/BEOS builds + + * harbour/source/common/hbprintf.c + ! removed wrongly added condition which disabled [u]intmax_t for GCC < 3 + + * harbour/source/rtl/gtcrs/gtcrs.h + ! do not redefine existing MAX_SIGNO + + * harbour/source/rtl/hbsocket.c + ! enabled MT safe socket functions in HAIKU/BEOS builds + + * harbour/config/beos/libs.mk + ! do not set explicitly GCC internal library paths. + They are configured in GCC config and should not be overloaded + in normal builds. + + TOFIX: error code are not properly decoded in HAIKU/BEOS builds. + It can be seen in hbtest results. It's possible that it's + HAIKU/BEOS problem not Harbour one. + 2009-09-15 20:07 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/source/rdd/dbf1.c * pacified BCC warning diff --git a/harbour/config/beos/libs.mk b/harbour/config/beos/libs.mk index 3783e69100..c46316bbb6 100644 --- a/harbour/config/beos/libs.mk +++ b/harbour/config/beos/libs.mk @@ -3,7 +3,7 @@ # SYSLIBS := -SYSLIBPATHS := /system/lib /boot/develop/abi/x86/gcc2/lib +SYSLIBPATHS := /system/lib ifneq ($(HB_LINKING_RTL),) ifeq ($(HB_CRS_LIB),) diff --git a/harbour/include/hbdate.h b/harbour/include/hbdate.h index c4396c9a6a..a56f272e6b 100644 --- a/harbour/include/hbdate.h +++ b/harbour/include/hbdate.h @@ -153,7 +153,7 @@ HB_EXTERN_END #if ( defined( _POSIX_C_SOURCE ) || defined( _XOPEN_SOURCE ) || \ defined( _BSD_SOURCE ) || defined( _SVID_SOURCE ) || \ - defined( HB_OS_SUNOS ) ) && \ + defined( HB_OS_SUNOS ) || defined( HB_OS_BEOS ) ) && \ ! defined( HB_OS_DARWIN_5 ) && !defined( HB_HAS_LOCALTIME_R ) # define HB_HAS_LOCALTIME_R #endif diff --git a/harbour/include/hbdefs.h b/harbour/include/hbdefs.h index f172cad29d..63f706d5b6 100644 --- a/harbour/include/hbdefs.h +++ b/harbour/include/hbdefs.h @@ -78,7 +78,8 @@ ( defined( __STDC_VERSION__ ) && __STDC_VERSION__ >= 199901L ) || \ ( defined( __DJGPP__ ) && \ ( __DJGPP__ > 2 || ( __DJGPP__ == 2 && __DJGPP_MINOR__ >= 4 ) ) ) || \ - defined( HB_OS_LINUX ) || defined( HB_OS_DARWIN ) || defined( HB_OS_SUNOS ) || defined( HB_OS_BEOS ) ) ) + defined( HB_OS_LINUX ) || defined( HB_OS_DARWIN ) || \ + defined( HB_OS_SUNOS ) || defined( HB_OS_BEOS ) ) ) #include /* workaround for BCC 5.8 bug */ #if ( defined( __BORLANDC__ ) && __BORLANDC__ >= 1410 ) diff --git a/harbour/include/hbinit.h b/harbour/include/hbinit.h index df31fac7cd..2744459da6 100644 --- a/harbour/include/hbinit.h +++ b/harbour/include/hbinit.h @@ -112,8 +112,7 @@ extern HB_EXPORT PHB_SYMB hb_vmProcessSymbols( PHB_SYMB pSymbols, USHORT uiSymbo #define HB_CALL_ON_STARTUP_END( func ) \ } -#elif defined( __GNUC__ ) || defined( __SUNPRO_C ) || defined( __SUNPRO_CC ) || \ - defined( __HAIKU__ ) +#elif defined( __GNUC__ ) || defined( __SUNPRO_C ) || defined( __SUNPRO_CC ) #if defined( HB_PRAGMA_STARTUP ) || defined( HB_MSC_STARTUP ) #error Wrong macros set for startup code - clean your make/env settings. diff --git a/harbour/include/hbsetup.h b/harbour/include/hbsetup.h index bcc7532741..0fa1b8d0ad 100644 --- a/harbour/include/hbsetup.h +++ b/harbour/include/hbsetup.h @@ -485,13 +485,17 @@ #if defined( __GNUC__ ) #define HB_PRINTF_FORMAT( _nStr, _nParam ) \ __attribute__ (( format (printf, _nStr, _nParam))) +# if ( __GNUC__ >= 3 ) #define HB_MALLOC_ATTR \ __attribute__ (( malloc )) +# else + #define HB_MALLOC_ATTR +# endif #define HB_HOT_ATTR \ __attribute__ (( hot )) #define HB_COLD_ATTR \ __attribute__ (( cold )) -#if 0 +# if 0 #define HB_NORETURN_ATTR \ __attribute__ (( noreturn )) # else diff --git a/harbour/include/hbvmpub.h b/harbour/include/hbvmpub.h index a3e526fad5..76c022b692 100644 --- a/harbour/include/hbvmpub.h +++ b/harbour/include/hbvmpub.h @@ -145,13 +145,13 @@ struct _HB_SYMB; #if !defined( HB_MT_VM ) void * pMemvar; /* memvar pointer ( publics & privates ) */ USHORT uiArea; /* Workarea number */ -#endif +#endif /* !HB_MT_VM */ USHORT uiSymNum; /* dynamic symbol number */ -#ifndef HB_NO_PROFILER +#if !defined( HB_NO_PROFILER ) ULONG ulCalls; /* profiler support */ ULONG ulTime; /* profiler support */ ULONG ulRecurse; /* profiler support */ -#endif +#endif /* !HB_NO_PROFILER */ } HB_DYNS, * PHB_DYNS, * HB_DYNS_PTR; /* pCode dynamic function - HRB */ @@ -161,7 +161,7 @@ struct _HB_SYMB; struct _HB_SYMB * pSymbols;/* module symbol table */ } HB_PCODEFUNC, * PHB_PCODEFUNC; -#else +#else /* !_HB_API_INTERNAL_ */ # undef HB_API_MACROS # undef HB_STACK_MACROS @@ -202,7 +202,7 @@ struct _HB_SYMB; typedef void * PHB_DYNS_PTR; #endif -#endif +#endif /* !_HB_API_INTERNAL_ */ /* symbol support structure */ typedef struct _HB_SYMB diff --git a/harbour/source/common/hbgete.c b/harbour/source/common/hbgete.c index 7ddc490d37..37133a00ed 100644 --- a/harbour/source/common/hbgete.c +++ b/harbour/source/common/hbgete.c @@ -158,7 +158,8 @@ BOOL hb_setenv( const char * szName, const char * szValue ) #elif defined( _BSD_SOURCE ) || _POSIX_C_SOURCE >= 200112L || \ _XOPEN_SOURCE >= 600 || defined( __WATCOMC__ ) || defined( __DJGPP__ ) || \ - defined( HB_OS_SUNOS ) || defined( HB_OS_BSD ) || defined( HB_OS_DARWIN ) + defined( HB_OS_SUNOS ) || defined( HB_OS_BSD ) || defined( HB_OS_DARWIN ) \ + defined( HB_OS_BEOS ) if( szValue ) return setenv( szName, szValue, 1 ) == 0; diff --git a/harbour/source/common/hbprintf.c b/harbour/source/common/hbprintf.c index 20b850f91b..351c8b5704 100644 --- a/harbour/source/common/hbprintf.c +++ b/harbour/source/common/hbprintf.c @@ -160,8 +160,7 @@ optimized. ( defined( __DJGPP__ ) && \ ( __DJGPP__ < 2 || ( __DJGPP__ == 2 && __DJGPP_MINOR__ <= 3 ) ) ) || \ ( defined( _MSC_VER ) && \ - !( defined( __LCC__ ) || defined( __POCC__ ) || defined( __XCC__ ) ) ) || \ - ( defined( __GNUC__ ) && __GNUC__ < 3 ) + !( defined( __LCC__ ) || defined( __POCC__ ) || defined( __XCC__ ) ) ) /* TODO: add other C compilers which does not support [u]intmax_t * definitions (check C compiler version number). * If compiler supports stdint.h then it should be added diff --git a/harbour/source/rtl/gtcrs/gtcrs.h b/harbour/source/rtl/gtcrs/gtcrs.h index 27aec3192b..261f8dd1fd 100644 --- a/harbour/source/rtl/gtcrs/gtcrs.h +++ b/harbour/source/rtl/gtcrs/gtcrs.h @@ -120,7 +120,9 @@ /* #define HB_GT_CRS_TTYHACK */ -#define MAX_SIGNO 64 +#ifndef MAX_SIGNO +# define MAX_SIGNO 64 +#endif #define BASE_INFD 0 #define BASE_OUTFD 1 diff --git a/harbour/source/rtl/hbsocket.c b/harbour/source/rtl/hbsocket.c index 4a6aaecaa2..9277f86a39 100644 --- a/harbour/source/rtl/hbsocket.c +++ b/harbour/source/rtl/hbsocket.c @@ -113,13 +113,15 @@ #if defined( HB_OS_UNIX ) && ! defined( __CYGWIN__ ) # define HB_HAS_UNIX -# if !defined( __WATCOMC__ ) && !defined( HB_OS_BEOS ) +# if !defined( __WATCOMC__ ) # define HB_HAS_INET_ATON # define HB_HAS_INET_PTON # define HB_HAS_INET_NTOP -# define HB_HAS_INET6 # define HB_HAS_SOCKADDR_STORAGE # define HB_HAS_ADDRINFO +# endif +# if !defined( __WATCOMC__ ) && !defined( HB_OS_BEOS ) +# define HB_HAS_INET6 # define HB_HAS_INET6_ADDR_CONST # endif # if defined( HB_OS_LINUX ) @@ -1044,7 +1046,7 @@ static void hb_socketSetOsError( int err ) uiErr = HB_SOCKET_ERR_PROTOTYPE; break; case EOPNOTSUPP: -#if defined( SOCKTNOSUPPORT ) +#if defined( ESOCKTNOSUPPORT ) case ESOCKTNOSUPPORT: #endif uiErr = HB_SOCKET_ERR_NOSUPPORT;