diff --git a/harbour/ChangeLog b/harbour/ChangeLog index fb96e63365..94fb760461 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,33 @@ past entries belonging to author(s): Viktor Szakats. */ +2009-07-31 11:09 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) + * include/hbdefs.h + * include/hbsetup.h + * include/hbinit.h + * source/vm/fm.c + + config/sunos/sunpro.cf + + Added first round of Sun Pro (Sun Studio) compiler. + Contribution of Tamas Tevesz. + ; TODO: + + Add other Sun Pro CPU targets. + * Finalize __inline keyword usage. (currently in fm.c) + Przemek, could you take a look at it? + ! Fix warning option. + + Add compiler identification code to hbver.c. + + hbmk2 support. + + dynamic lib creation. + + * utils/hbmk2/hbmk2.prg + * Minor rename. + + * contrib/hbclipsm/gauge.c + % Minor opt, plus removed cast. + + * contrib/hbwin/wce_smsc.c + * contrib/hbwin/wce_sim.prg + * Minor formatting. + 2009-07-31 10:26 UTC+0200 Francesco Saverio Giudice (info/at/fsgiudice.com) * harbour/examples/httpsrv/uhttpd.prg * Uploaded Handler_HrbScript() changes missed in previous upload. diff --git a/harbour/config/sunos/sunpro.cf b/harbour/config/sunos/sunpro.cf new file mode 100644 index 0000000000..ba2b6317cd --- /dev/null +++ b/harbour/config/sunos/sunpro.cf @@ -0,0 +1,105 @@ +# +# $Id$ +# + +ifeq ($(HB_BUILD_MODE),cpp) + HB_CMP = CC +else + HB_CMP = cc +endif + +OBJ_EXT = .o +EXE_EXT = +LIB_PREF = lib +LIB_EXT = .a + +CC = $(HB_CCACHE) $(HB_CMP) +CC_IN = -c +# NOTE: The ending space after -o is important, please preserve it. +# Now solved with '$(subst x,x, )' expression. +CC_OUT = -o$(subst x,x, ) + +CPPFLAGS = -I. -I$(HB_INC_COMPILE) + +CFLAGS = +LDFLAGS = + +ifneq ($(HB_BUILD_WARN),no) +# XXX: +# gmake[2]: Entering directory `/home/ice/harbour-build/source/rtl' +# gmake[3]: Entering directory `/home/ice/harbour-build/source/rtl/obj/sunos/sunpro' +# cc -I. -I../../../../../include -errwarn=%all -O -xcode=pic32 -c browdbx.c -o browdbx.o +# "browdbx.c", line 8: warning: empty translation unit +# cc: acomp failed for browdbx.c +# gmake[3]: *** [browdbx.o] Error 2 +# gmake[3]: Leaving directory `/home/ice/harbour-build/source/rtl/obj/sunos/sunpro' +# CFLAGS += -errwarn=%all +CFLAGS += +endif + +ifneq ($(HB_BUILD_OPTIM),no) +CFLAGS += -O +endif + +ifeq ($(findstring sparc,$(shell isalist)),sparc) +CFLAGS += -xcode=pic32 +else +CFLAGS += -KPIC +endif + +ifeq ($(HB_BUILD_DEBUG),yes) +CFLAGS += -g +endif + +LD = $(HB_CCACHE) $(HB_CMP) +LD_OUT = -o + +# Add all libraries specified in LIBS. +LINKPATHS += -L$(LIB_DIR) +LINKLIBS += $(foreach lib, $(LIBS), -l$(lib)) + +# If LIBS specifies the RDD library, add all DB drivers. +ifeq ($(findstring hbrdd,$(LIBS)),hbrdd) +LINKLIBS += $(foreach drv, $(HB_DB_DRIVERS), -l$(drv)) +endif + +# Add the specified GT driver library +ifeq ($(findstring hbrtl,$(LIBS)),hbrtl) + +LINKLIBS += $(foreach gt, $(HB_GT_LIBS), -l$(gt)) -lhbrtl + +# screen driver libraries +ifeq ($(HB_CRS_LIB),) +HB_CRS_LIB = curses +endif +ifneq ($(findstring gtcrs, $(HB_GT_LIBS)),) +LINKLIBS += -l$(HB_CRS_LIB) +endif +ifneq ($(findstring gtsln, $(HB_GT_LIBS)),) +LINKLIBS += -lslang +endif +ifneq ($(findstring gtxwc, $(HB_GT_LIBS)),) +LINKLIBS += -lX11 +LINKPATHS += -L/usr/X11R6/lib +endif + +endif + +ifneq ($(findstring -DHB_PCRE_REGEX, $(HB_USER_CFLAGS)),) +LINKLIBS += -lpcre +endif + +ifneq ($(findstring -DHB_EXT_ZLIB, $(HB_USER_CFLAGS)),) +LINKLIBS += -lz +endif + +LINKLIBS += -lm -lrt +LINKLIBS += -lsocket -lnsl -lresolv + +LDFLAGS += $(LINKPATHS) + +AR = ar +ARFLAGS = $(HB_USER_AFLAGS) +AR_RULE = $(AR) $(ARFLAGS) cr $(LIB_DIR)/$@ $(^F) || ( $(RM) $(LIB_DIR)/$@ && false ) + +include $(TOP)$(ROOT)config/rules.cf diff --git a/harbour/contrib/hbclipsm/gauge.c b/harbour/contrib/hbclipsm/gauge.c index 0071a00d7b..40ab4e22b8 100644 --- a/harbour/contrib/hbclipsm/gauge.c +++ b/harbour/contrib/hbclipsm/gauge.c @@ -76,7 +76,6 @@ static void hb_gaugeUpdate( PHB_ITEM pArray, float fPercent ) int iCols; int iMax; char szOldColor[ HB_CLRSTR_LEN ]; - const char * szStr = " "; char szPct[ 5 ]; hb_gtGetColorStr( szOldColor ); @@ -97,9 +96,9 @@ static void hb_gaugeUpdate( PHB_ITEM pArray, float fPercent ) hb_arrayGetNI( pArray, B_LEFT ) + 1, hb_arrayGetNI( pArray, B_BOTTOM ) - 1, hb_arrayGetNI( pArray, B_RIGHT ) - 1, - szStr ); + " " ); - iMax = ( int ) ( hb_arrayGetNI( pArray, B_BOTTOM ) - hb_arrayGetNI( pArray, B_TOP ) - 1 ); + iMax = hb_arrayGetNI( pArray, B_BOTTOM ) - hb_arrayGetNI( pArray, B_TOP ) - 1; for( iRow = 1; iRow <= iMax; iRow++ ) { hb_gtRepChar( hb_arrayGetNI( pArray, B_TOP ) + iRow, @@ -152,7 +151,6 @@ HB_FUNC( GAUGEDISPLAY ) { int iCenter = ( ( hb_arrayGetNI( pArray, B_RIGHT ) - hb_arrayGetNI( pArray, B_LEFT ) ) / 2 ) + 1; char szOldColor[ HB_CLRSTR_LEN ]; - const char * szStr = " "; hb_gtGetColorStr( szOldColor ); hb_gtSetColorStr( hb_arrayGetCPtr( pArray, B_BACKCOLOR ) ); @@ -161,7 +159,7 @@ HB_FUNC( GAUGEDISPLAY ) hb_arrayGetNI( pArray, B_LEFT ), hb_arrayGetNI( pArray, B_BOTTOM ), hb_arrayGetNI( pArray, B_RIGHT ), - szStr ); + " " ); hb_gtBox( hb_arrayGetNI( pArray, B_TOP ), hb_arrayGetNI( pArray, B_LEFT ), diff --git a/harbour/contrib/hbwin/wce_sim.prg b/harbour/contrib/hbwin/wce_sim.prg index 0e75eca910..32ff20e09b 100644 --- a/harbour/contrib/hbwin/wce_sim.prg +++ b/harbour/contrib/hbwin/wce_sim.prg @@ -70,7 +70,7 @@ CREATE CLASS wce_sim METHOD lInitialize() // Must be initialized before any other method METHOD lDeInitialize() // Must be deinitialized.... - METHOD lNumberOfPhoneBookEntries( nType, nTotal , nUsed ) // nTotal, nUsed both by reference + METHOD lNumberOfPhoneBookEntries( nType, nTotal, nUsed ) // nTotal, nUsed both by reference METHOD aGetAllPhoneBookEntries( nType ) // -> array with phoneBook entries of nType storage METHOD lGetSimPhoneEntry( nPos, nType, aEntry ) // -> aEntry by refence contains phonebook entry METHOD lSetSimPhoneEntry( nPos, nType, cNumber, cName, nPlan, nAddrType ) // -> .T. / .F. if phonebook entry written @@ -154,7 +154,7 @@ METHOD aGetAllPhoneBookEntries( nType ) CLASS wce_sim ENDIF NEXT - ::nLastError := nResult + ::nLastError := nResult RETURN aEntries @@ -170,7 +170,7 @@ METHOD lGetSimPhoneEntry( nPos, nType, /* @ */ aEntry ) CLASS wce_sim DEFAULT nType TO SIM_PBSTORAGE_SIM - nResult := SimReadPhoneBookEntry(::hSim, nType, nPos, @a) + nResult := SimReadPhoneBookEntry( ::hSim, nType, nPos, @a ) aEntry := { a } ::nLastError := nResult diff --git a/harbour/contrib/hbwin/wce_smsc.c b/harbour/contrib/hbwin/wce_smsc.c index b2e186f097..d9b75ab10c 100644 --- a/harbour/contrib/hbwin/wce_smsc.c +++ b/harbour/contrib/hbwin/wce_smsc.c @@ -69,9 +69,9 @@ HB_FUNC( SMSSENDMESSAGE ) /* cMessage, cNumber */ TEXT_PROVIDER_SPECIFIC_DATA tpsd; SMS_MESSAGE_ID smsmidMessageID = 0; - wchar_t * sztMessage = HB_TCHAR_CONVTO( hb_parcx( 1 ) ); - wchar_t * sztPhoneNumber = HB_TCHAR_CONVTO( hb_parcx( 2 ) ); - BOOL bInternational = ( *sztPhoneNumber == '+' ); + wchar_t * sztMessage = HB_TCHAR_CONVTO( hb_parcx( 1 ) ); + wchar_t * sztPhoneNumber = HB_TCHAR_CONVTO( hb_parcx( 2 ) ); + BOOL bInternational = ( *sztPhoneNumber == '+' ); /* Create the destination address */ memset( &smsaDestination, 0, sizeof( smsaDestination ) ); diff --git a/harbour/include/hbdefs.h b/harbour/include/hbdefs.h index 2e6138ba03..19547e0ce0 100644 --- a/harbour/include/hbdefs.h +++ b/harbour/include/hbdefs.h @@ -73,7 +73,7 @@ defined( __MINGW32__ ) || defined( __DMC__ ) || \ ( defined( __BORLANDC__ ) && __BORLANDC__ >= 1410 ) || \ ( defined( __WATCOMC__ ) && __WATCOMC__ >= 1270 ) || \ - ( defined( __GNUC__ ) && \ + ( ( defined( __GNUC__ ) || defined( __SUNPRO_C ) ) && \ ( defined( _ISOC99_SOURCE ) || \ ( defined( __STDC_VERSION__ ) && __STDC_VERSION__ >= 199901L ) || \ ( defined( __DJGPP__ ) && \ @@ -248,14 +248,14 @@ #if ! defined( HB_DONT_DEFINE_BASIC_TYPES ) && ! defined( _WINNT_H ) #if !defined( LONGLONG ) - #if defined( __GNUC__ ) + #if defined( __GNUC__ ) || defined( __SUNPRO_C ) typedef signed long long LONGLONG; #else typedef __int64 LONGLONG; #endif #endif #if !defined( ULONGLONG ) - #if defined( __GNUC__ ) + #if defined( __GNUC__ ) || defined( __SUNPRO_C ) typedef unsigned long long ULONGLONG; #else typedef unsigned __int64 ULONGLONG; diff --git a/harbour/include/hbinit.h b/harbour/include/hbinit.h index ef53562a44..0c2856ee90 100644 --- a/harbour/include/hbinit.h +++ b/harbour/include/hbinit.h @@ -112,7 +112,7 @@ extern HB_EXPORT PHB_SYMB hb_vmProcessSymbols( PHB_SYMB pSymbols, USHORT uiSymbo #define HB_CALL_ON_STARTUP_END( func ) \ } -#elif defined( __GNUC__ ) +#elif defined( __GNUC__ ) || defined( __SUNPRO_C ) #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 b563217a7d..59065fea9d 100644 --- a/harbour/include/hbsetup.h +++ b/harbour/include/hbsetup.h @@ -177,7 +177,7 @@ /* *********************************************************************** * Operating system specific definitions */ -#if ( defined( __GNUC__ ) && \ +#if ( ( defined( __GNUC__ ) || defined( __SUNPRO_C ) ) && \ ! ( defined( __DJGPP__ ) || defined( __EMX__ ) || defined( __RSXNT__ ) || \ defined( _Windows ) || defined( _WIN32 ) || defined( _WINCE ) ) ) || \ ( defined( __WATCOMC__ ) && defined( __LINUX__ ) ) diff --git a/harbour/source/vm/fm.c b/harbour/source/vm/fm.c index af9d788005..de6087f7c0 100644 --- a/harbour/source/vm/fm.c +++ b/harbour/source/vm/fm.c @@ -77,6 +77,10 @@ # define _GNU_SOURCE #endif +#if defined( __SUNPRO_C ) + #define __inline __inline__ +#endif + /* NOTE: For OS/2. Must be ahead of any and all #include statements */ #define INCL_BASE #define INCL_DOSMISC diff --git a/harbour/utils/hbmk2/hbmk2.prg b/harbour/utils/hbmk2/hbmk2.prg index 1a653c031a..d78c946a1b 100644 --- a/harbour/utils/hbmk2/hbmk2.prg +++ b/harbour/utils/hbmk2/hbmk2.prg @@ -161,7 +161,7 @@ REQUEST hbmk_KEYW #define _ESC_NONE 0 #define _ESC_DBLQUOTE 1 -#define _ESC_SINQUOTE_WATCOM 2 +#define _ESC_SGLQUOTE_WATCOM 2 #define _ESC_NIX 3 #define _MACRO_NORM_PREFIX "$" @@ -2480,7 +2480,7 @@ FUNCTION hbmk( aArgs, /* @ */ lPause, /* @ */ lUTF8 ) CASE hbmk[ _HBMK_cARCH ] == "win" .AND. hbmk[ _HBMK_cCOMP ] == "watcom" nCmd_Esc := _ESC_DBLQUOTE - nScr_Esc := _ESC_SINQUOTE_WATCOM + nScr_Esc := _ESC_SGLQUOTE_WATCOM cLibPrefix := "LIB " cLibExt := ".lib" cObjPrefix := "FILE " @@ -4776,7 +4776,7 @@ STATIC FUNCTION ArrayToList( array, cSeparator, nEscapeMode, cPrefix ) ENDIF NEXT EXIT - CASE _ESC_SINQUOTE_WATCOM + CASE _ESC_SGLQUOTE_WATCOM FOR tmp := 1 TO Len( array ) IF " " $ array[ tmp ] /* Sloppy */ @@ -5012,7 +5012,7 @@ STATIC FUNCTION FN_Escape( cFileName, nEscapeMode ) RETURN '"' + cFileName + '"' ENDIF EXIT - CASE _ESC_SINQUOTE_WATCOM + CASE _ESC_SGLQUOTE_WATCOM IF " " $ cFileName /* Sloppy */ IF Right( cFileName, 1 ) == "\"