From 93e0db5a23e4a7ab33092f6ede77f966d93c47fc Mon Sep 17 00:00:00 2001 From: Przemyslaw Czerpak Date: Sat, 9 Dec 2006 16:11:10 +0000 Subject: [PATCH] 2006-12-09 17:10 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/config/bsd/gcc.cf * harbour/config/darwin/gcc.cf * harbour/config/dos/bcc16.cf * harbour/config/dos/djgpp.cf * harbour/config/dos/owatcom.cf * harbour/config/dos/rsx32.cf * harbour/config/hpux/gcc.cf * harbour/config/linux/gcc.cf * harbour/config/linux/owatcom.cf * harbour/config/os2/gcc.cf * harbour/config/os2/icc.cf * harbour/config/sunos/gcc.cf * harbour/config/w32/bcc32.cf * harbour/config/w32/gcc.cf * harbour/config/w32/mingw32.cf * harbour/config/w32/msvc.cf * harbour/config/w32/rsxnt.cf * harbour/config/w32/watcom.cf * added respecting HB_GT_DEFAULT, though it's quite possible that I'll remove it at all soon. * some other cleanup * harbour/source/compiler/complex.c ! fixed wrongly replicated from FLEX lexer condition used to DECLARE. Now they should be the same as in FLEX lexer but IMHO they are not Clipper compatible. * harbour/source/compiler/gencli.c * harbour/source/compiler/gencobj.c * harbour/source/compiler/genhrb.c * harbour/source/compiler/genjava.c * harbour/source/compiler/genobj32.c * harbour/source/compiler/harbour.c * harbour/source/rtl/hbffind.c * harbour/source/pp/ppcore.c * harbour/source/rdd/workarea.c ! fixed sizes of some C stack buffers and strncpy() parameters * use hb_strn*() instead of strn*() in few places to be sure that 0 is always stored in destination buffer * harbour/source/rtl/gtcgi/gtcgi.c * change reported GT name from "Standard stream console" to "Raw stream console" to make it differ then GTSTD one. --- harbour/ChangeLog | 45 ++++++++++++++++++++++++++++++ harbour/config/bsd/gcc.cf | 26 ++++++++++++++++- harbour/config/darwin/gcc.cf | 30 ++++++++++++++------ harbour/config/dos/bcc16.cf | 5 ++++ harbour/config/dos/djgpp.cf | 8 ++++++ harbour/config/dos/owatcom.cf | 14 ++++++++-- harbour/config/dos/rsx32.cf | 10 ++++++- harbour/config/hpux/gcc.cf | 7 +++++ harbour/config/linux/gcc.cf | 10 +++---- harbour/config/linux/owatcom.cf | 5 ++++ harbour/config/os2/gcc.cf | 8 ++++++ harbour/config/os2/icc.cf | 8 ++++++ harbour/config/sunos/gcc.cf | 7 +++++ harbour/config/w32/bcc32.cf | 7 +++++ harbour/config/w32/gcc.cf | 8 ++++++ harbour/config/w32/mingw32.cf | 8 ++++++ harbour/config/w32/msvc.cf | 8 ++++++ harbour/config/w32/rsxnt.cf | 8 ++++++ harbour/config/w32/watcom.cf | 5 ++++ harbour/source/compiler/complex.c | 32 ++++++++++++--------- harbour/source/compiler/gencli.c | 2 +- harbour/source/compiler/gencobj.c | 2 +- harbour/source/compiler/genhrb.c | 2 +- harbour/source/compiler/genjava.c | 2 +- harbour/source/compiler/genobj32.c | 2 +- harbour/source/compiler/harbour.c | 4 +-- harbour/source/pp/ppcore.c | 4 +-- harbour/source/rdd/workarea.c | 2 +- harbour/source/rtl/gtcgi/gtcgi.c | 2 +- harbour/source/rtl/hbffind.c | 2 +- 30 files changed, 240 insertions(+), 43 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 616b20df33..a83b785f9b 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,51 @@ 2002-12-01 13:30 UTC+0100 Foo Bar */ +2006-12-09 17:10 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl) + * harbour/config/bsd/gcc.cf + * harbour/config/darwin/gcc.cf + * harbour/config/dos/bcc16.cf + * harbour/config/dos/djgpp.cf + * harbour/config/dos/owatcom.cf + * harbour/config/dos/rsx32.cf + * harbour/config/hpux/gcc.cf + * harbour/config/linux/gcc.cf + * harbour/config/linux/owatcom.cf + * harbour/config/os2/gcc.cf + * harbour/config/os2/icc.cf + * harbour/config/sunos/gcc.cf + * harbour/config/w32/bcc32.cf + * harbour/config/w32/gcc.cf + * harbour/config/w32/mingw32.cf + * harbour/config/w32/msvc.cf + * harbour/config/w32/rsxnt.cf + * harbour/config/w32/watcom.cf + * added respecting HB_GT_DEFAULT, though it's quite possible that I'll + remove it at all soon. + * some other cleanup + + * harbour/source/compiler/complex.c + ! fixed wrongly replicated from FLEX lexer condition used to DECLARE. + Now they should be the same as in FLEX lexer but IMHO they are not + Clipper compatible. + + * harbour/source/compiler/gencli.c + * harbour/source/compiler/gencobj.c + * harbour/source/compiler/genhrb.c + * harbour/source/compiler/genjava.c + * harbour/source/compiler/genobj32.c + * harbour/source/compiler/harbour.c + * harbour/source/rtl/hbffind.c + * harbour/source/pp/ppcore.c + * harbour/source/rdd/workarea.c + ! fixed sizes of some C stack buffers and strncpy() parameters + * use hb_strn*() instead of strn*() in few places to be sure that 0 + is always stored in destination buffer + + * harbour/source/rtl/gtcgi/gtcgi.c + * change reported GT name from "Standard stream console" to + "Raw stream console" to make it differ then GTSTD one. + 2006-12-08 05:55 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/bin/hb-func.sh * harbour/bin/hb-mkslib.sh diff --git a/harbour/config/bsd/gcc.cf b/harbour/config/bsd/gcc.cf index f57a606b30..9629a76fa3 100644 --- a/harbour/config/bsd/gcc.cf +++ b/harbour/config/bsd/gcc.cf @@ -37,10 +37,17 @@ LINKPATHS += $(foreach drv, $(HB_DB_DRIVERS), -L$(TOP)$(ROOT)source/rdd/$(drv)/$ LINKLIBS += $(foreach drv, $(HB_DB_DRIVERS), -l$(drv)) endif -# Add the specified GT driver library +# Add the specified GT driver library and other RTLs ifeq ($(findstring rtl,$(LIBS)),rtl) + LINKPATHS += -L$(TOP)$(ROOT)source/rtl/$(HB_GT_LIB)/$(HB_ARCH) LINKLIBS += -l$(HB_GT_LIB) + +ifneq ($(HB_GT_DEFAULT),) +ifneq ($(HB_GT_DEFAULT),$(HB_GT_LIB)) +LINKPATHS += -L$(TOP)$(ROOT)source/rtl/$(HB_GT_DEFAULT)/$(HB_ARCH) +LINKLIBS += -l$(HB_GT_DEFAULT) +endif endif # HB_SCREEN_LIB: empty, or one of ncurses, slang @@ -49,6 +56,21 @@ HB_SCREEN_LIB:=ncurses else ifeq ($(HB_GT_LIB),gtsln) HB_SCREEN_LIB:=slang +else +ifeq ($(HB_GT_LIB),gtalleg) +HB_GTALLEG:=yes +LINKLIBS += `allegro-config --static` +endif +endif +endif + +ifeq ($(HB_GT_LIB),gtxvt) +LINKLIBS += -lX11 +LINKPATHS += -L/usr/X11R6/lib +else +ifeq ($(HB_GT_LIB),gtxwc) +LINKLIBS += -lX11 +LINKPATHS += -L/usr/X11R6/lib endif endif @@ -57,6 +79,8 @@ LINKPATHS += -L/usr/local/lib LINKLIBS += -l$(HB_SCREEN_LIB) endif +endif + LINKLIBS += -lm -Wl,--end-group LDFLAGS += $(LINKPATHS) diff --git a/harbour/config/darwin/gcc.cf b/harbour/config/darwin/gcc.cf index a6a90e3f8c..9ed2f8d713 100644 --- a/harbour/config/darwin/gcc.cf +++ b/harbour/config/darwin/gcc.cf @@ -51,28 +51,31 @@ LINKPATHS += $(foreach drv, $(HB_DB_DRIVERS), -L$(TOP)$(ROOT)source/rdd/$(drv)/$ LINKLIBS += $(foreach drv, $(HB_DB_DRIVERS), -l$(drv)) endif -# Add the specified GT driver library +# Add the specified GT driver library and other RTLs ifeq ($(findstring rtl,$(LIBS)),rtl) LINKPATHS += -L$(TOP)$(ROOT)source/rtl/$(HB_GT_LIB)/$(HB_ARCH) LINKLIBS += -l$(HB_GT_LIB) +ifneq ($(HB_GT_DEFAULT),) +ifneq ($(HB_GT_DEFAULT),$(HB_GT_LIB)) +LINKPATHS += -L$(TOP)$(ROOT)source/rtl/$(HB_GT_DEFAULT)/$(HB_ARCH) +LINKLIBS += -l$(HB_GT_DEFAULT) +endif +endif + # HB_SCREEN_LIB: empty, or one of ncurses, slang ifeq ($(HB_GT_LIB),gtcrs) HB_SCREEN_LIB:=ncurses else ifeq ($(HB_GT_LIB),gtsln) HB_SCREEN_LIB:=slang +else +ifeq ($(HB_GT_LIB),gtalleg) +HB_GTALLEG:=yes +LINKLIBS += `allegro-config --static` endif endif - -ifneq ($(HB_SCREEN_LIB),) -LINKLIBS += -l$(HB_SCREEN_LIB) -endif - -# In BSD, slang still needs curses :( -ifeq ($(HB_GT_LIB),gtsln) -LINKLIBS += -lncurses endif ifeq ($(HB_GT_LIB),gtxvt) @@ -85,6 +88,15 @@ LINKPATHS +=-L/usr/X11R6/lib endif endif +ifneq ($(HB_SCREEN_LIB),) +LINKLIBS += -l$(HB_SCREEN_LIB) +endif + +# In BSD, slang still needs curses :( +ifeq ($(HB_GT_LIB),gtsln) +LINKLIBS += -lncurses +endif + # HB_GPM_MOUSE: use gpm mouse driver # Actually, there is no gpm on BSD. ifeq ($(HB_GPM_MOUSE),yes) diff --git a/harbour/config/dos/bcc16.cf b/harbour/config/dos/bcc16.cf index 836106ef5d..2629395143 100644 --- a/harbour/config/dos/bcc16.cf +++ b/harbour/config/dos/bcc16.cf @@ -65,6 +65,11 @@ LD_RULE = $(link_exe_file) # Add the specified GT driver library ifeq ($(findstring rtl,$(LIBS)),rtl) LINKLIBS += $(TOP)$(ROOT)source/rtl/$(HB_GT_LIB)/$(HB_ARCH)/$(HB_GT_LIB)$(LIB_EXT) +ifneq ($(HB_GT_DEFAULT),) +ifneq ($(HB_GT_DEFAULT),$(HB_GT_LIB)) +LINKLIBS += $(TOP)$(ROOT)source/rtl/$(HB_GT_DEFAULT)/$(HB_ARCH)/$(HB_GT_DEFAULT)$(LIB_EXT) +endif +endif endif # HB_SCREEN_LIB: empty, or one of ncurses, slang diff --git a/harbour/config/dos/djgpp.cf b/harbour/config/dos/djgpp.cf index 90a24991d5..0ea7ebcae3 100644 --- a/harbour/config/dos/djgpp.cf +++ b/harbour/config/dos/djgpp.cf @@ -42,6 +42,14 @@ endif ifeq ($(findstring rtl,$(LIBS)),rtl) LINKPATHS += -L$(TOP)$(ROOT)source/rtl/$(HB_GT_LIB)/$(HB_ARCH) LINKLIBS += -l$(HB_GT_LIB) + +ifneq ($(HB_GT_DEFAULT),) +ifneq ($(HB_GT_DEFAULT),$(HB_GT_LIB)) +LINKPATHS += -L$(TOP)$(ROOT)source/rtl/$(HB_GT_DEFAULT)/$(HB_ARCH) +LINKLIBS += -l$(HB_GT_DEFAULT) +endif +endif + endif # NOTE: The empty line directly before 'endef' HAVE TO exist! diff --git a/harbour/config/dos/owatcom.cf b/harbour/config/dos/owatcom.cf index d75b513ab6..c0bda3cc59 100644 --- a/harbour/config/dos/owatcom.cf +++ b/harbour/config/dos/owatcom.cf @@ -73,10 +73,11 @@ endif # If LIBS specifies the rdd library, add all DB drivers. ifeq ($(findstring rdd,$(LIBS)),rdd) ifeq ($(HB_LIB_COMPILE),) - RDDLIBS := $(foreach drv, $(HB_DB_DRIVERS), $(subst /,\,$(TOP)$(ROOT)source/rdd/$(drv)/$(HB_ARCH)/$(drv))) + RDDLIBS := $(foreach drv, $(HB_DB_DRIVERS), $(TOP)$(ROOT)source/rdd/$(drv)/$(HB_ARCH)/$(drv)) else - RDDLIBS := $(foreach drv, $(HB_DB_DRIVERS), $(subst /,\,$(HB_LIB_COMPILE)/$(drv))) + RDDLIBS := $(foreach drv, $(HB_DB_DRIVERS), $(HB_LIB_COMPILE)/$(drv)) endif + RDDLIBS := $(subst /,\,$(RDDLIBS)) endif ifeq ($(findstring rtl,$(LIBS)),rtl) @@ -85,6 +86,15 @@ ifeq ($(findstring rtl,$(LIBS)),rtl) else GTLIBS := $(HB_LIB_COMPILE)/$(HB_GT_LIB) endif + ifneq ($(HB_GT_DEFAULT),) + ifneq ($(HB_GT_DEFAULT),$(HB_GT_LIB)) + ifeq ($(HB_LIB_COMPILE),) + GTLIBS += $(TOP)$(ROOT)source/rtl/$(HB_GT_DEFAULT)/$(HB_ARCH)/$(HB_GT_DEFAULT) + else + GTLIBS += $(HB_LIB_COMPILE)/$(HB_GT_DEFAULT) + endif + endif + endif GTLIBS := $(subst /,\,$(GTLIBS)) endif diff --git a/harbour/config/dos/rsx32.cf b/harbour/config/dos/rsx32.cf index 60084f2469..67a4b50bd5 100644 --- a/harbour/config/dos/rsx32.cf +++ b/harbour/config/dos/rsx32.cf @@ -42,10 +42,18 @@ LINKPATHS += $(foreach drv, $(HB_DB_DRIVERS), -L$(TOP)$(ROOT)source/rdd/$(drv)/$ LINKLIBS += $(foreach drv, $(HB_DB_DRIVERS), -l$(drv)) endif -# Add the specified GT driver library +# Add the specified GT driver library and other RTLs ifeq ($(findstring rtl,$(LIBS)),rtl) LINKPATHS += -L$(TOP)$(ROOT)source/rtl/$(HB_GT_LIB)/$(HB_ARCH) LINKLIBS += -l$(HB_GT_LIB) + +ifneq ($(HB_GT_DEFAULT),) +ifneq ($(HB_GT_DEFAULT),$(HB_GT_LIB)) +LINKPATHS += -L$(TOP)$(ROOT)source/rtl/$(HB_GT_DEFAULT)/$(HB_ARCH) +LINKLIBS += -l$(HB_GT_DEFAULT) +endif +endif + endif # HB_SCREEN_LIB: empty, or one of ncurses, slang diff --git a/harbour/config/hpux/gcc.cf b/harbour/config/hpux/gcc.cf index 5e06d83439..22819df7f3 100644 --- a/harbour/config/hpux/gcc.cf +++ b/harbour/config/hpux/gcc.cf @@ -46,6 +46,13 @@ ifeq ($(findstring rtl,$(LIBS)),rtl) LINKPATHS += -L$(TOP)$(ROOT)source/rtl/$(HB_GT_LIB)/$(HB_ARCH) LINKLIBS += -l$(HB_GT_LIB) +ifneq ($(HB_GT_DEFAULT),) +ifneq ($(HB_GT_DEFAULT),$(HB_GT_LIB)) +LINKPATHS += -L$(TOP)$(ROOT)source/rtl/$(HB_GT_DEFAULT)/$(HB_ARCH) +LINKLIBS += -l$(HB_GT_DEFAULT) +endif +endif + # HB_SCREEN_LIB: empty, or one of curses, slang ifeq ($(HB_GT_LIB),gtcrs) HB_SCREEN_LIB:=curses diff --git a/harbour/config/linux/gcc.cf b/harbour/config/linux/gcc.cf index 2eff9cf10e..c28a099f01 100644 --- a/harbour/config/linux/gcc.cf +++ b/harbour/config/linux/gcc.cf @@ -59,7 +59,7 @@ LINKLIBS += -l$(HB_GT_LIB) ifneq ($(HB_GT_DEFAULT),) ifneq ($(HB_GT_DEFAULT),$(HB_GT_LIB)) -LINKPATHS += -L$(TOP)$(ROOT)source/rtl/$(HB_GT_DEFAULT)/$(ARCH) +LINKPATHS += -L$(TOP)$(ROOT)source/rtl/$(HB_GT_DEFAULT)/$(HB_ARCH) LINKLIBS += -l$(HB_GT_DEFAULT) endif endif @@ -78,10 +78,6 @@ endif endif endif -ifneq ($(HB_SCREEN_LIB),) -LINKLIBS += -l$(HB_SCREEN_LIB) -endif - ifeq ($(HB_GT_LIB),gtxvt) LINKLIBS += -lX11 #LINKPATHS += -L/usr/X11R6/lib64 @@ -94,6 +90,10 @@ LINKPATHS += -L/usr/X11R6/lib endif endif +ifneq ($(HB_SCREEN_LIB),) +LINKLIBS += -l$(HB_SCREEN_LIB) +endif + # HB_GPM_MOUSE: use gpm mouse driver ifeq ($(HB_GPM_MOUSE),yes) LINKLIBS += -lgpm diff --git a/harbour/config/linux/owatcom.cf b/harbour/config/linux/owatcom.cf index 27e18b2e65..dccb108a3b 100644 --- a/harbour/config/linux/owatcom.cf +++ b/harbour/config/linux/owatcom.cf @@ -60,6 +60,11 @@ ifeq ($(findstring rtl,$(LIBS)),rtl) else GTLIBS := $(HB_LIB_COMPILE)/$(HB_GT_LIB) endif + ifneq ($(HB_GT_DEFAULT),) + ifneq ($(HB_GT_DEFAULT),$(HB_GT_LIB)) + GTLIBS := $(TOP)$(ROOT)source/rtl/$(HB_GT_DEFAULT)/$(HB_ARCH)/$(HB_GT_DEFAULT) + endif + endif endif LDFILES = $(subst $(space),$(comma) ,$(^F)) diff --git a/harbour/config/os2/gcc.cf b/harbour/config/os2/gcc.cf index 32f905533c..cc3d728936 100644 --- a/harbour/config/os2/gcc.cf +++ b/harbour/config/os2/gcc.cf @@ -62,6 +62,14 @@ LINKLIBS += -lgtos2 else LINKPATHS += -L$(TOP)$(ROOT)source/rtl/$(HB_GT_LIB)/$(HB_ARCH) LINKLIBS += -l$(HB_GT_LIB) + +ifneq ($(HB_GT_DEFAULT),) +ifneq ($(HB_GT_DEFAULT),$(HB_GT_LIB)) +LINKPATHS += -L$(TOP)$(ROOT)source/rtl/$(HB_GT_DEFAULT)/$(HB_ARCH) +LINKLIBS += -l$(HB_GT_DEFAULT) +endif +endif + endif endif endif diff --git a/harbour/config/os2/icc.cf b/harbour/config/os2/icc.cf index f1fdc99c3f..ee3475e619 100644 --- a/harbour/config/os2/icc.cf +++ b/harbour/config/os2/icc.cf @@ -53,6 +53,14 @@ LINKLIBS += $(TOP)$(ROOT)contrib/hgf/$(HB_GT_LIB)/$(HB_ARCH)/$(HB_GT_LIB)$(LIB_E LINKLIBS += $(TOP)$(ROOT)source/rtl/gtos2/$(HB_ARCH)/gtos2.lib else LINKLIBS += $(TOP)$(ROOT)source/rtl/$(HB_GT_LIB)/$(HB_ARCH)/$(HB_GT_LIB)$(LIB_EXT) + +ifneq ($(HB_GT_DEFAULT),) +ifneq ($(HB_GT_DEFAULT),$(HB_GT_LIB)) +LINKPATHS += -L$(TOP)$(ROOT)source/rtl/$(HB_GT_DEFAULT)/$(HB_ARCH) +LINKLIBS += -l$(HB_GT_DEFAULT) +endif +endif + endif endif endif diff --git a/harbour/config/sunos/gcc.cf b/harbour/config/sunos/gcc.cf index 993e5e52ba..47fa7abada 100644 --- a/harbour/config/sunos/gcc.cf +++ b/harbour/config/sunos/gcc.cf @@ -46,6 +46,13 @@ ifeq ($(findstring rtl,$(LIBS)),rtl) LINKPATHS += -L$(TOP)$(ROOT)source/rtl/$(HB_GT_LIB)/$(HB_ARCH) LINKLIBS += -l$(HB_GT_LIB) +ifneq ($(HB_GT_DEFAULT),) +ifneq ($(HB_GT_DEFAULT),$(HB_GT_LIB)) +LINKPATHS += -L$(TOP)$(ROOT)source/rtl/$(HB_GT_DEFAULT)/$(HB_ARCH) +LINKLIBS += -l$(HB_GT_DEFAULT) +endif +endif + # HB_SCREEN_LIB: empty, or one of curses, slang ifeq ($(HB_GT_LIB),gtcrs) HB_SCREEN_LIB:=curses diff --git a/harbour/config/w32/bcc32.cf b/harbour/config/w32/bcc32.cf index 9de0d85bb0..9d33ee5735 100644 --- a/harbour/config/w32/bcc32.cf +++ b/harbour/config/w32/bcc32.cf @@ -53,6 +53,13 @@ endif # Add the specified GT driver library ifeq ($(findstring rtl,$(LIBS)),rtl) LINKLIBS += $(TOP)$(ROOT)source/rtl/$(HB_GT_LIB)/$(HB_ARCH)/$(HB_GT_LIB)$(LIB_EXT) + +ifneq ($(HB_GT_DEFAULT),) +ifneq ($(HB_GT_DEFAULT),$(HB_GT_LIB)) +LINKLIBS += $(TOP)$(ROOT)source/rtl/$(HB_GT_DEFAULT)/$(HB_ARCH)/$(HB_GT_DEFAULT)$(LIB_EXT) +endif +endif + endif # HB_SCREEN_LIB: empty, or one of ncurses, slang diff --git a/harbour/config/w32/gcc.cf b/harbour/config/w32/gcc.cf index c99a7116e9..32f00a2a90 100644 --- a/harbour/config/w32/gcc.cf +++ b/harbour/config/w32/gcc.cf @@ -46,6 +46,14 @@ endif ifeq ($(findstring rtl,$(LIBS)),rtl) LINKPATHS += -L$(TOP)$(ROOT)source/rtl/$(HB_GT_LIB)/$(HB_ARCH) LINKLIBS += -l$(HB_GT_LIB) + +ifneq ($(HB_GT_DEFAULT),) +ifneq ($(HB_GT_DEFAULT),$(HB_GT_LIB)) +LINKPATHS += -L$(TOP)$(ROOT)source/rtl/$(HB_GT_DEFAULT)/$(HB_ARCH) +LINKLIBS += -l$(HB_GT_DEFAULT) +endif +endif + endif # HB_SCREEN_LIB: empty, or one of ncurses, slang diff --git a/harbour/config/w32/mingw32.cf b/harbour/config/w32/mingw32.cf index 064ac9c7e2..5ea5ba91b0 100644 --- a/harbour/config/w32/mingw32.cf +++ b/harbour/config/w32/mingw32.cf @@ -51,6 +51,14 @@ endif ifeq ($(findstring rtl,$(LIBS)),rtl) LINKPATHS += -L$(TOP)$(ROOT)source/rtl/$(HB_GT_LIB)/$(HB_ARCH) LDLIBS += -l$(HB_GT_LIB) + +ifneq ($(HB_GT_DEFAULT),) +ifneq ($(HB_GT_DEFAULT),$(HB_GT_LIB)) +LINKPATHS += -L$(TOP)$(ROOT)source/rtl/$(HB_GT_DEFAULT)/$(HB_ARCH) +LINKLIBS += -l$(HB_GT_DEFAULT) +endif +endif + endif # HB_SCREEN_LIB: empty, or one of ncurses, slang diff --git a/harbour/config/w32/msvc.cf b/harbour/config/w32/msvc.cf index 49c4d449f4..83ace41113 100644 --- a/harbour/config/w32/msvc.cf +++ b/harbour/config/w32/msvc.cf @@ -38,6 +38,14 @@ endif ifeq ($(findstring rtl,$(LIBS)),rtl) LINKPATHS += -LIBPATH:$(TOP)$(ROOT)source/rtl/$(HB_GT_LIB)/$(HB_ARCH) LINKLIBS += $(HB_GT_LIB)$(LIB_EXT) + +ifneq ($(HB_GT_DEFAULT),) +ifneq ($(HB_GT_DEFAULT),$(HB_GT_LIB)) +LINKPATHS += -LIBPATH:$(TOP)$(ROOT)source/rtl/$(HB_GT_DEFAULT)/$(HB_ARCH) +LINKLIBS += $(HB_GT_DEFAULT)$(LIB_EXT) +endif +endif + endif LDFLAGS = $(LINKPATHS) diff --git a/harbour/config/w32/rsxnt.cf b/harbour/config/w32/rsxnt.cf index c8b3895951..ccaf7f4aed 100644 --- a/harbour/config/w32/rsxnt.cf +++ b/harbour/config/w32/rsxnt.cf @@ -49,6 +49,14 @@ endif ifeq ($(findstring rtl,$(LIBS)),rtl) LINKPATHS += -L$(TOP)$(ROOT)source/rtl/$(HB_GT_LIB)/$(HB_ARCH) LINKLIBS += -l$(HB_GT_LIB) + +ifneq ($(HB_GT_DEFAULT),) +ifneq ($(HB_GT_DEFAULT),$(HB_GT_LIB)) +LINKPATHS += -L$(TOP)$(ROOT)source/rtl/$(HB_GT_DEFAULT)/$(HB_ARCH) +LINKLIBS += -l$(HB_GT_DEFAULT) +endif +endif + endif # HB_SCREEN_LIB: empty, or one of ncurses, slang diff --git a/harbour/config/w32/watcom.cf b/harbour/config/w32/watcom.cf index 586b1de68d..de43b089a4 100644 --- a/harbour/config/w32/watcom.cf +++ b/harbour/config/w32/watcom.cf @@ -65,6 +65,11 @@ endif ifeq ($(findstring rtl,$(LIBS)),rtl) GTLIBS := $(TOP)$(ROOT)source/rtl/$(HB_GT_LIB)/$(HB_ARCH)/$(HB_GT_LIB) +ifneq ($(HB_GT_DEFAULT),) +ifneq ($(HB_GT_DEFAULT),$(HB_GT_LIB)) +GTLIBS := $(TOP)$(ROOT)source/rtl/$(HB_GT_DEFAULT)/$(HB_ARCH)/$(HB_GT_DEFAULT) +endif +endif GTLIBS := $(subst /,\,$(GTLIBS)) endif diff --git a/harbour/source/compiler/complex.c b/harbour/source/compiler/complex.c index 4f23cc5bd0..6de9fad18c 100644 --- a/harbour/source/compiler/complex.c +++ b/harbour/source/compiler/complex.c @@ -766,24 +766,30 @@ int hb_complex( YYSTYPE *yylval_ptr, HB_COMP_DECL ) break; case DECLARE: - if( pLex->iState == LOOKUP ) + if( pLex->iState == LOOKUP && + !HB_PP_TOKEN_ISEOC( pToken->pNext ) ) { - if( !HB_PP_TOKEN_ISEOC( pToken->pNext ) && - ( HB_PP_TOKEN_TYPE( pToken->pNext->type ) == HB_PP_TOKEN_MACROVAR || - HB_PP_TOKEN_TYPE( pToken->pNext->type ) == HB_PP_TOKEN_MACROTEXT || - ( HB_PP_TOKEN_TYPE( pToken->pNext->type ) == HB_PP_TOKEN_KEYWORD && - ( HB_PP_TOKEN_ISEOC( pToken->pNext->pNext ) || - HB_PP_TOKEN_TYPE( pToken->pNext->pNext->type ) == HB_PP_TOKEN_LEFT_SB || - HB_PP_TOKEN_TYPE( pToken->pNext->pNext->type ) == HB_PP_TOKEN_COMMA || - HB_PP_TOKEN_TYPE( pToken->pNext->pNext->type ) == HB_PP_TOKEN_SEND || - ( HB_PP_TOKEN_TYPE( pToken->pNext->pNext->type ) == HB_PP_TOKEN_KEYWORD && - hb_stricmp( "AS", pToken->pNext->pNext->value ) == 0 ) ) ) ) ) + if( HB_PP_TOKEN_TYPE( pToken->pNext->type ) == HB_PP_TOKEN_MACROVAR || + HB_PP_TOKEN_TYPE( pToken->pNext->type ) == HB_PP_TOKEN_MACROTEXT ) { pLex->iState = PRIVATE; return PRIVATE; } - pLex->iState = DECLARE; - return DECLARE; + else if( HB_PP_TOKEN_TYPE( pToken->pNext->type ) == HB_PP_TOKEN_KEYWORD ) + { + if( HB_PP_TOKEN_ISEOC( pToken->pNext->pNext ) || + HB_PP_TOKEN_TYPE( pToken->pNext->pNext->type ) == HB_PP_TOKEN_LEFT_SB || + HB_PP_TOKEN_TYPE( pToken->pNext->pNext->type ) == HB_PP_TOKEN_COMMA || + HB_PP_TOKEN_TYPE( pToken->pNext->pNext->type ) == HB_PP_TOKEN_ASSIGN || + ( HB_PP_TOKEN_TYPE( pToken->pNext->pNext->type ) == HB_PP_TOKEN_KEYWORD && + hb_stricmp( "AS", pToken->pNext->pNext->value ) == 0 ) ) + { + pLex->iState = PRIVATE; + return PRIVATE; + } + pLex->iState = DECLARE; + return DECLARE; + } } iType = IDENTIFIER; break; diff --git a/harbour/source/compiler/gencli.c b/harbour/source/compiler/gencli.c index e7cff5beef..68a2f0d85b 100644 --- a/harbour/source/compiler/gencli.c +++ b/harbour/source/compiler/gencli.c @@ -58,7 +58,7 @@ typedef HB_GENC_FUNC_ * HB_GENC_FUNC_PTR; void hb_compGenILCode( HB_COMP_DECL, PHB_FNAME pFileName ) /* generates the IL output */ { - char szFileName[ _POSIX_PATH_MAX ], * szVer; + char szFileName[ _POSIX_PATH_MAX + 1 ], * szVer; PFUNCTION pFunc = HB_COMP_PARAM->functions.pFirst; PCOMSYMBOL pSym = HB_COMP_PARAM->symbols.pFirst; PINLINE pInline; diff --git a/harbour/source/compiler/gencobj.c b/harbour/source/compiler/gencobj.c index 13832b25d3..59e369fc31 100644 --- a/harbour/source/compiler/gencobj.c +++ b/harbour/source/compiler/gencobj.c @@ -173,7 +173,7 @@ void hb_compGenCObj( HB_COMP_DECL, PHB_FNAME pFileName ) if( HB_COMP_PARAM->pOutPath ) { PHB_FNAME pOut = hb_fsFNameSplit( ( char * ) szFileName ); - char pszTemp[ _POSIX_PATH_MAX ] = ""; + char pszTemp[ _POSIX_PATH_MAX + 1 ] = ""; if( HB_COMP_PARAM->pOutPath->szPath ) pOut->szPath = HB_COMP_PARAM->pOutPath->szPath; diff --git a/harbour/source/compiler/genhrb.c b/harbour/source/compiler/genhrb.c index 902e9628cd..87b58f64fa 100644 --- a/harbour/source/compiler/genhrb.c +++ b/harbour/source/compiler/genhrb.c @@ -34,7 +34,7 @@ void hb_compGenPortObj( HB_COMP_DECL, PHB_FNAME pFileName ) { - char szFileName[ _POSIX_PATH_MAX ]; + char szFileName[ _POSIX_PATH_MAX + 1 ]; PFUNCTION pFunc /*= HB_COMP_PARAM->functions.pFirst*/; PCOMSYMBOL pSym = HB_COMP_PARAM->symbols.pFirst; ULONG lPCodePos; diff --git a/harbour/source/compiler/genjava.c b/harbour/source/compiler/genjava.c index 2fec14ca6b..e69da2ea47 100644 --- a/harbour/source/compiler/genjava.c +++ b/harbour/source/compiler/genjava.c @@ -61,7 +61,7 @@ static int hb_fputs( char * szName, FILE * fOut, int nChar ) void hb_compGenJava( HB_COMP_DECL, PHB_FNAME pFileName ) { - char szFileName[ _POSIX_PATH_MAX ], * szVer; + char szFileName[ _POSIX_PATH_MAX + 1 ], * szVer; PFUNCTION pFunc /*= HB_COMP_PARAM->functions.pFirst */; PCOMSYMBOL pSym = HB_COMP_PARAM->symbols.pFirst; ULONG lPCodePos; diff --git a/harbour/source/compiler/genobj32.c b/harbour/source/compiler/genobj32.c index 3f2842c977..c0a2f9bfb8 100644 --- a/harbour/source/compiler/genobj32.c +++ b/harbour/source/compiler/genobj32.c @@ -64,7 +64,7 @@ static char * szPrefix = "_HB_FUN_"; void hb_compGenObj32( HB_COMP_DECL, PHB_FNAME pFileName ) { - char szFileName[ _POSIX_PATH_MAX ]; + char szFileName[ _POSIX_PATH_MAX + 1 ]; FILE * hObjFile; /* file handle for OBJ output */ char * szVer; diff --git a/harbour/source/compiler/harbour.c b/harbour/source/compiler/harbour.c index f647b948be..405720cb2e 100644 --- a/harbour/source/compiler/harbour.c +++ b/harbour/source/compiler/harbour.c @@ -4800,8 +4800,8 @@ static int hb_compAutoOpen( HB_COMP_DECL, char * szPrg, BOOL * pbSkipGen, BOOL b if( HB_COMP_PARAM->pFileName->szName ) { - char szFileName[ _POSIX_PATH_MAX ]; /* filename to parse */ - char szPpoName[ _POSIX_PATH_MAX ]; + char szFileName[ _POSIX_PATH_MAX + 1 ]; /* filename to parse */ + char szPpoName[ _POSIX_PATH_MAX + 1 ]; /* Clear and reinitialize preprocessor state */ hb_pp_reset( HB_COMP_PARAM->pLex->pPP ); diff --git a/harbour/source/pp/ppcore.c b/harbour/source/pp/ppcore.c index f1199bf1f0..5f77af15ca 100644 --- a/harbour/source/pp/ppcore.c +++ b/harbour/source/pp/ppcore.c @@ -4539,7 +4539,7 @@ void hb_pp_initDynDefines( PHB_PP_STATE pState ) /* __PLATFORM__* */ pSrc = szPlatform = hb_verPlatform(); - pDst = strncpy( szDefine, "__PLATFORM__", sizeof( szDefine ) ); + pDst = hb_strncpy( szDefine, "__PLATFORM__", sizeof( szDefine ) - 1 ); i = 12; while( pSrc[ 0 ] > ' ' && i < ( int ) sizeof( szDefine ) - 1 ) { @@ -4564,7 +4564,7 @@ void hb_pp_initDynDefines( PHB_PP_STATE pState ) hb_pp_addDefine( pState, szDefine, szResult ); #ifdef HB_OS_UNIX - strncpy( szDefine + 12, "UNIX", sizeof( szDefine ) ); + hb_strncpy( szDefine + 12, "UNIX", sizeof( szDefine ) - 13 ); hb_pp_addDefine( pState, szDefine, szResult ); #endif diff --git a/harbour/source/rdd/workarea.c b/harbour/source/rdd/workarea.c index c068e967a8..b6f8f571b9 100644 --- a/harbour/source/rdd/workarea.c +++ b/harbour/source/rdd/workarea.c @@ -1527,7 +1527,7 @@ ERRCODE hb_waError( AREAP pArea, PHB_ITEM pError ) if( pArea && pArea->lprfsHost->sysName ) SELF_SYSNAME( pArea, ( BYTE * ) szRddName ); else - strncpy( szRddName, "???DRIVER", HARBOUR_MAX_RDD_DRIVERNAME_LENGTH ); + hb_strncpy( szRddName, "???DRIVER", HARBOUR_MAX_RDD_DRIVERNAME_LENGTH ); hb_errPutSeverity( pError, ES_ERROR ); hb_errPutSubSystem( pError, szRddName ); hb_xfree( szRddName ); diff --git a/harbour/source/rtl/gtcgi/gtcgi.c b/harbour/source/rtl/gtcgi/gtcgi.c index 76fae7326d..8f45d17384 100644 --- a/harbour/source/rtl/gtcgi/gtcgi.c +++ b/harbour/source/rtl/gtcgi/gtcgi.c @@ -176,7 +176,7 @@ static char * hb_gt_cgi_Version( int iType ) if( iType == 0 ) return HB_GT_DRVNAME( HB_GT_NAME ); - return "Harbour Terminal: Standard stream console"; + return "Harbour Terminal: Raw stream console"; } static void hb_gt_cgi_Scroll( int iTop, int iLeft, int iBottom, int iRight, diff --git a/harbour/source/rtl/hbffind.c b/harbour/source/rtl/hbffind.c index 0540abc3ee..356b8bb611 100644 --- a/harbour/source/rtl/hbffind.c +++ b/harbour/source/rtl/hbffind.c @@ -741,7 +741,7 @@ static BOOL hb_fsFindNextLow( PHB_FFIND ffind ) { /* Do the conversions common for all platforms */ - ffind->szName[ _POSIX_PATH_MAX ] = '\0'; + ffind->szName[ _POSIX_PATH_MAX + 1 ] = '\0'; ffind->attr = hb_fsAttrFromRaw( raw_attr );