diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 3303c6e06b..94661be434 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,19 @@ +19990518-18:00 David G. Holm + + buildicc.cmd + - New file for IBM C++ 3.0 for OS/2 + + makefile.icc + - New file for IBM C++ 3.0 for OS/2 + * include/types.h + - Added #ifdef for IBM C++ 3.0 for OS/2 + * source/compiler/harbour.c + - Added #ifdef and isatty() for IBM C++ 3.0 for OS/2 + * source/rtl/environ.c + - Added #ifdef for IBM C++ 3.0 for OS/2 + + tests/working/biccexe.cmd + - New file for IBM C++ 3.0 for OS/2 + + tests/working/hbicc.cmd + - New file for IBM C++ 3.0 for OS/2 + 19990518-23:40 CET Eddie Runia * source/compiler/harbour.y GenPortObj added. Can be accessed through /gHRB @@ -39,27 +55,27 @@ 19990518-03:05 Ryszard Glab * source/compiler/harbour.l - -corrected misspelled wCaseCounter - + -corrected misspelled wCaseCounter + * include/hberrors.h - -new errors definition added (it should be uploaded in previous - commit -sorry my fault - + -new errors definition added (it should be uploaded in previous + commit -sorry my fault + 19990518-01:45 Ryszard Glab - * source/compiler/harbour.l, source/compiler/harbour.y - -added support for '-i' option (#include file search path) - however it doesn't use SET INCLUDE environment variable yet - -added error messages if unmatched ENDDO, ENDCASE, ENDIF, NEXT - is found + * source/compiler/harbour.l, source/compiler/harbour.y + -added support for '-i' option (#include file search path) + however it doesn't use SET INCLUDE environment variable yet + -added error messages if unmatched ENDDO, ENDCASE, ENDIF, NEXT + is found - * include/extend.h - -added forward declaration of CODEBLOCK structure and added - the proper type for pCodeblock member of ITEM structure + * include/extend.h + -added forward declaration of CODEBLOCK structure and added + the proper type for pCodeblock member of ITEM structure - * source/vm/hvm.c - -corrected pCodeblock type casting - -added C++ style declaration of HB_FIRSTSYMBOL and HB_LASTSYMBOL + * source/vm/hvm.c + -corrected pCodeblock type casting + -added C++ style declaration of HB_FIRSTSYMBOL and HB_LASTSYMBOL 19990517-16:05 CET Eddie Runia * source/rtl/classes.c, source/rtl/tclass.prg, include/extend.h @@ -90,48 +106,48 @@ 19990516-07:04 Ryszard Glab * source/compiler/harbour.l, source/compiler/harbour.y - -cleaned rules for NEXT, BREAK, WHILE, BEGIN, DO to be 100% - Clipper compatible (mainly keyword[] use); - -corrected support for END keyword; - -added include files: hbsetup.h and hberrors.h; - -code for OBJ generation is now linked optionally -it is linked if - the symbol OBJ_GENERATION is defined in hbsetup.h file; - -corrected the generation of EXTERNAL symbols + -cleaned rules for NEXT, BREAK, WHILE, BEGIN, DO to be 100% + Clipper compatible (mainly keyword[] use); + -corrected support for END keyword; + -added include files: hbsetup.h and hberrors.h; + -code for OBJ generation is now linked optionally -it is linked if + the symbol OBJ_GENERATION is defined in hbsetup.h file; + -corrected the generation of EXTERNAL symbols * source/vm/hvm.c - -code with support for symbols defined in OBJ files is now linked - optionally -it is linked if the symbol OBJ_GENERATION is defined - in hbsetup.h file - -added support for optional definition of the starting procedure - (in case when automatic lookup for it doesn't work (Watcom C/C++)) + -code with support for symbols defined in OBJ files is now linked + optionally -it is linked if the symbol OBJ_GENERATION is defined + in hbsetup.h file + -added support for optional definition of the starting procedure + (in case when automatic lookup for it doesn't work (Watcom C/C++)) * include/hbsetup.h - -new file with Harbour configuration options (see this file for - available options) + -new file with Harbour configuration options (see this file for + available options) * include/hberrors.h - -new file with error constants definition shared by - harbour.y and harbour.l + -new file with error constants definition shared by + harbour.y and harbour.l * include/extend.h - -added declaration of FindDynSym() function used in hvm.c + -added declaration of FindDynSym() function used in hvm.c * source/rtl/environ.c - -added correct #include for Watcom C/C++ to use REGS union - (although I am not sure if OS function should be placed here) + -added correct #include for Watcom C/C++ to use REGS union + (although I am not sure if OS function should be placed here) * source/rtl/itemapi.c - -corrected wrog declaration of symEval variable - (it is SYMBOL structure instead of PSYMBOL pointer) + -corrected wrog declaration of symEval variable + (it is SYMBOL structure instead of PSYMBOL pointer) * tests/working/keywords.prg - -added test code for END keyword + -added test code for END keyword * makewat.env, makefile.wat - -added/corrected makefiles for Watcom C/C++ compiler + -added/corrected makefiles for Watcom C/C++ compiler * makedos.env, makefile.dos - -added/corrected makefiles for pure DOS DJGPP compiler + -added/corrected makefiles for pure DOS DJGPP compiler 19990516-06:30 CET Eddie Runia * tests/working/bld32exe.bat @@ -291,33 +307,33 @@ Tue May 11 18:53:43 1999 Gonzalo A. Diethelm - * Makefile: - Added obj to the list of directories. - - * source/Makefile: - Added rdd to the list of directories. + * Makefile: + Added obj to the list of directories. - * source/rtl/Makefile: - Added gtapi.c to the list of C sources. - - * source/rtl/gtapi.c: - Got rid of two warnings with gcc. - - * source/rtl/environ.c: - Made sure it compiles with gcc. - There was a missing #endif. - - * source/tools/stringp.prg: - * tests/working/debugtst.prg: - Replaced Debug() with HBDebug(), otherwise the generated C source - collides with the macro DEBUG. - - * source/vm/hvm.c: - Corrected a comment. - - * source/rdd/Makefile: - * obj/Makefile: - Added these two Makefiles. + * source/Makefile: + Added rdd to the list of directories. + + * source/rtl/Makefile: + Added gtapi.c to the list of C sources. + + * source/rtl/gtapi.c: + Got rid of two warnings with gcc. + + * source/rtl/environ.c: + Made sure it compiles with gcc. + There was a missing #endif. + + * source/tools/stringp.prg: + * tests/working/debugtst.prg: + Replaced Debug() with HBDebug(), otherwise the generated C source + collides with the macro DEBUG. + + * source/vm/hvm.c: + Corrected a comment. + + * source/rdd/Makefile: + * obj/Makefile: + Added these two Makefiles. 19990511-19:20 Eddie Runia * source/rtl/classes.c @@ -356,17 +372,17 @@ Tue May 11 18:53:43 1999 Gonzalo A. Diethelm Mon May 10 19:32:34 1999 Gonzalo A. Diethelm - * makefile.b32: - Added source/compiler/harbour.c to this makefile. - - * source/compiler/Makefile: - Added genobj32.c. - - * source/compiler/genobj32.c: - Got rid of warnings. - - * source/compiler/harbour.y: - Added '/' as path separator. + * makefile.b32: + Added source/compiler/harbour.c to this makefile. + + * source/compiler/Makefile: + Added genobj32.c. + + * source/compiler/genobj32.c: + Got rid of warnings. + + * source/compiler/harbour.y: + Added '/' as path separator. 19990510-11:30 Eddie Runia * source/rtl/classes.c @@ -392,13 +408,13 @@ Mon May 10 19:32:34 1999 Gonzalo A. Diethelm 19990510-01:19 Ryszard Glab * source/compiler/harbour.l, source/compiler/harbour.y - - corrected syntax check for: case-> case+= case-= - - DO/WHILE/CASE/WITH is now 100% compatible with Clipper - - there is still problem with comments that ends with **/ - (exactly two asterix and slash) + - corrected syntax check for: case-> case+= case-= + - DO/WHILE/CASE/WITH is now 100% compatible with Clipper + - there is still problem with comments that ends with **/ + (exactly two asterix and slash) * tests/working/keywords.prg - - added code to test DO/WHILE/CASE/WITH + - added code to test DO/WHILE/CASE/WITH 19900509-23:30 Eddie Runia * source/working/mankala.prg @@ -471,28 +487,28 @@ Mon May 10 19:32:34 1999 Gonzalo A. Diethelm Sat May 8 03:02:04 1999 Ryszard Glab * source/compiler/harbour.y, source/compiler/harbour.l - -static variables can be accessed in a codeblock even if this - codeblock is a return value (detached static variables) - -Harbour finds now illegal initializations of static variables - (static variables can be initialized using literals only) - -there is no 'redefinition of predefined function' error when the name - of compiled source code is the same as reserved function - -corrected support for /*******/ comments - -Harbour distinguish now 'CASE' variable, 'CASE()' function and - CASE statement (see tests/working/keywords.prg) + -static variables can be accessed in a codeblock even if this + codeblock is a return value (detached static variables) + -Harbour finds now illegal initializations of static variables + (static variables can be initialized using literals only) + -there is no 'redefinition of predefined function' error when the name + of compiled source code is the same as reserved function + -corrected support for /*******/ comments + -Harbour distinguish now 'CASE' variable, 'CASE()' function and + CASE statement (see tests/working/keywords.prg) * tests/working/keywords.prg - -added many more wild statements to test Harbour compiler + -added many more wild statements to test Harbour compiler * test/working/statics.prg - -added code to test access of static variables from a codeblock + -added code to test access of static variables from a codeblock * source/rtl/extend.c - -added brackets to avoid ambiguous if/else + -added brackets to avoid ambiguous if/else * source/include/extend.h * source/rtl/codebloc.c - - added support for static variables in a codeblock + - added support for static variables in a codeblock 19990507-20:15 EDT David G. Holm @@ -534,10 +550,10 @@ Thu May 07 17:00:00 1999 Victor Szel 19990507-07:25 Ryszard Glab * source/compiler/harbour.y, source/compiler/harbour.l - -improoved support for BEGIN SEGEUENCE - -added distinction between BEGIN command and begin variable - -added distinction between BREAK command and break variable - + -improoved support for BEGIN SEGEUENCE + -added distinction between BEGIN command and begin variable + -added distinction between BREAK command and break variable + * tests/working/keywords.prg -new file to test if we are 100% compatible with Clipper diff --git a/harbour/buildicc.cmd b/harbour/buildicc.cmd new file mode 100644 index 0000000000..43c84f6bd5 --- /dev/null +++ b/harbour/buildicc.cmd @@ -0,0 +1 @@ +nmake /F makefile.icc /R %1 %2 %3 diff --git a/harbour/include/types.h b/harbour/include/types.h index 6402c0d79c..10eeb725fa 100644 --- a/harbour/include/types.h +++ b/harbour/include/types.h @@ -5,6 +5,14 @@ #ifndef _TYPES_H #define _TYPES_H +#ifdef __IBMCPP__ + #define INCL_TYPES + #include + typedef unsigned short int WORD; + #undef INT + #undef UINT +#else + #undef BYTE typedef unsigned char BYTE, * PBYTE; /* 1 byte */ @@ -37,6 +45,8 @@ typedef void * PVOID; #define HIBYTE(w) ((BYTE)(((WORD)(w) >> 8) & 0xFF)) #define LOWORD(l) ((WORD)(l)) +#endif /* __IBMCPP__ */ + #ifdef __GNUC__ #define pascal __attribute__ ((stdcall)) #endif diff --git a/harbour/makefile.icc b/harbour/makefile.icc new file mode 100644 index 0000000000..2103e91764 --- /dev/null +++ b/harbour/makefile.icc @@ -0,0 +1,109 @@ +# makefile for IBM C Compiler (32 bits) + +.SUFFIXES : .prg .c + +path_c = source\compiler;source\vm;source\rtl;source\tools +path_h = include +path_l = source\compiler +path_y = source\compiler +path_exe = bin +path_lib = libs\icc +path_obj = obj +path_prg = source\rtl + +c_opt = /W2 /Se /Sd+ /I.\include /Ti+ + +all: $(path_exe)\harbour.exe $(path_lib)\harbour.lib $(path_lib)\hbtools.lib $(path_lib)\terminal.lib + +$(path_lib)\harbour.lib : $(path_obj)\arrays.obj \ + $(path_obj)\classes.obj \ + $(path_obj)\codebloc.obj \ + $(path_obj)\console.obj \ + $(path_obj)\dates.obj \ + $(path_obj)\dynsym.obj \ + $(path_obj)\environ.obj \ + $(path_obj)\error.obj \ + $(path_obj)\errorapi.obj \ + $(path_obj)\errorsys.obj \ + $(path_obj)\extend.obj \ + $(path_obj)\itemapi.obj \ + $(path_obj)\math.obj \ + $(path_obj)\set.obj \ + $(path_obj)\strings.obj \ + $(path_obj)\strcmp.obj \ + $(path_obj)\tclass.obj \ + $(path_obj)\transfrm.obj + @echo Harbour.lib + +$(path_lib)\hbtools.lib: \ + $(path_obj)\debug.obj \ + $(path_obj)\genobj.obj \ + $(path_obj)\mathx.obj \ + $(path_obj)\stringsx.obj \ + #(path_obj)\datesx.obj + @echo HBtools.lib + +$(path_lib)\terminal.lib :$(path_obj)\console.obj + @echo terminal.lib + +$(path_obj)\console.obj : {$(path_c)}console.c $(path_h)\extend.h $(path_h)\types.h + icc /C+ $(c_opt) /Fo$@ /Tpsource\rtl\console.c + ilib .\libs\icc\harbour.lib -+$@,, + +$(path_obj)\arrays.obj : {$(path_c)}arrays.c $(path_h)\extend.h $(path_h)\types.h +$(path_obj)\classes.obj : {$(path_c)}classes.c $(path_h)\extend.h $(path_h)\types.h +$(path_obj)\codebloc.obj : {$(path_c)}codebloc.c $(path_h)\extend.h $(path_h)\types.h +$(path_obj)\dates.obj : {$(path_c)}dates.c $(path_h)\extend.h $(path_h)\types.h +$(path_obj)\datesx.obj : {$(path_c)}datesx.c $(path_h)\extend.h $(path_h)\types.h +$(path_obj)\environ.obj : {$(path_c)}environ.c $(path_h)\extend.h $(path_h)\types.h +$(path_obj)\errorapi.obj : {$(path_c)}errorapi.c $(path_h)\extend.h $(path_h)\types.h +$(path_obj)\extend.obj : {$(path_c)}extend.c $(path_h)\extend.h $(path_h)\types.h +#$(path_obj)\files.obj : {$(path_c)}extend.c $(path_h)\extend.h $(path_h)\types.h +$(path_obj)\itemapi.obj : {$(path_c)}itemapi.c $(path_h)\extend.h $(path_h)\types.h +$(path_obj)\math.obj : {$(path_c)}math.c $(path_h)\extend.h $(path_h)\types.h +$(path_obj)\mathx.obj : {$(path_c)}mathx.c $(path_h)\extend.h $(path_h)\types.h +$(path_obj)\set.obj : {$(path_c)}set.c $(path_h)\extend.h $(path_h)\types.h +$(path_obj)\strcmp.obj : {$(path_c)}strcmp.c $(path_h)\extend.h $(path_h)\types.h +$(path_obj)\strings.obj : {$(path_c)}strings.c $(path_h)\extend.h $(path_h)\types.h +$(path_obj)\stringsx.obj : {$(path_c)}stringsx.c $(path_h)\extend.h $(path_h)\types.h +$(path_obj)\transfrm.obj : {$(path_c)}transfrm.c $(path_h)\extend.h $(path_h)\types.h + +$(path_obj)\dynsym.obj : source\vm\dynsym.c $(path_h)\extend.h $(path_h)\types.h + icc /C+ $(c_opt) /Fo$@ /Tpsource\vm\dynsym.c + ilib .\libs\icc\harbour.lib -+$@,, + +$(path_obj)\error.obj : $(path_prg)\error.prg $(path_h)\init.h $(path_h)\extend.h $(path_h)\types.h {$(path_exe)}harbour.exe + $(path_exe)\harbour $(path_prg)\error /n /osource\rtl + icc /C+ $(c_opt) /Fo$@ /Tp$(path_prg)\error.c + ilib .\libs\icc\harbour.lib -+$@,, + +$(path_obj)\errorsys.obj : $(path_prg)\errorsys.prg $(path_h)\init.h $(path_h)\extend.h $(path_h)\types.h {$(path_exe)}harbour.exe + $(path_exe)\harbour $(path_prg)\errorsys /n /osource\rtl + icc /C+ $(c_opt) /Fo$@ /Tp$(path_prg)\errorsys.c + ilib .\libs\icc\harbour.lib -+$@,, + +$(path_obj)\tclass.obj : $(path_prg)\tclass.prg $(path_h)\init.h $(path_h)\extend.h $(path_h)\types.h {$(path_exe)}harbour.exe + $(path_exe)\harbour $(path_prg)\tclass /n /osource\rtl + icc /C+ $(c_opt) /Fo$@ /Tp$(path_prg)\tclass.c + ilib .\libs\icc\harbour.lib -+$@,, + +{source\rtl}.c{$(path_obj)}.obj: + icc /C+ $(c_opt) /Fo$@ /Tp$< + ilib .\libs\icc\harbour.lib -+$@,, + +{source\tools}.c{$(path_obj)}.obj: + icc /C+ $(c_opt) /Fo$@ /Tp$< + ilib .\libs\icc\hbtools.lib -+$@,, + +$(path_exe)\harbour.exe : {$(path_c)}y_tab.c {$(path_c)}lexyy.c {$(path_c)}genobj32.c {$(path_c)}harbour.c + icc /C- $(c_opt) /Fe$(path_exe)\harbour.exe /Isource\compiler \ + /Fo$(path_obj)\y_tab.obj /Tpsource\compiler\y_tab.c \ + /Fo$(path_obj)\lexyy.obj /Tpsource\compiler\lexyy.c \ + /Fo$(path_obj)\genobj32.obj /Tpsource\compiler\genobj32.c \ + /Fo$(path_obj)\harbour.obj /Tpsource\compiler\harbour.c + +y_tab.c : {$(path_y)}harbour.y +# bison -d -v -y -osource\compiler\y_tab.c source\compiler\harbour.y + +lexyy.c : {$(path_l)}harbour.l +# flex -i -8 -osource\compiler\lexyy.c -Sd:\bin\emx\lib\flexskel.cc -Hd:\bin\emx\include\flexskel.h source\compiler\harbour.l diff --git a/harbour/source/compiler/harbour.c b/harbour/source/compiler/harbour.c index 4621e2680c..c89621bc1f 100644 --- a/harbour/source/compiler/harbour.c +++ b/harbour/source/compiler/harbour.c @@ -8,3 +8,10 @@ int main( int argc, char * argv[] ) { return harbour_main(argc, argv); } + +#ifdef __IBMCPP__ +int isatty (int handle) +{ + return (handle < 4) ? 1 : 0; +} +#endif diff --git a/harbour/source/rtl/environ.c b/harbour/source/rtl/environ.c index fca88c55f9..0d3a994058 100644 --- a/harbour/source/rtl/environ.c +++ b/harbour/source/rtl/environ.c @@ -2,6 +2,10 @@ * $Id$ */ +#ifdef __IBMCPP__ + #define INCL_DOSMISC +#endif + #include #ifdef __WATCOMC__ @@ -10,6 +14,24 @@ HARBOUR OS() { +#ifdef __IBMCPP__ + + char buffer [256]; + unsigned long aulQSV [QSV_MAX] = {0}; + APIRET rc= DosQuerySysInfo (1L, QSV_MAX, (PVOID) aulQSV, sizeof (ULONG) * QSV_MAX); + if (rc) + _retc("OS/2"); + else + { + sprintf(buffer, "OS/2 %lu.%lu%c", aulQSV [QSV_VERSION_MAJOR] / 10, + aulQSV [QSV_VERSION_MINOR], + (aulQSV [QSV_VERSION_REVISION] > 0 && aulQSV [QSV_VERSION_REVISION] < 26) + ? '@' + aulQSV [QSV_VERSION_REVISION] : 0); + _retc(buffer); + } + +#else + #ifdef __GNUC__ _retc("UNKNOWN"); @@ -110,6 +132,7 @@ HARBOUR OS() _retc("MS-DOS"); #endif /* __GNUC__ */ +#endif /* __IBMCPP__ */ } HARBOUR VERSION() @@ -141,4 +164,3 @@ HARBOUR GETENV() else _retc(""); } - diff --git a/harbour/tests/working/biccexe.cmd b/harbour/tests/working/biccexe.cmd new file mode 100644 index 0000000000..d5c90f4763 --- /dev/null +++ b/harbour/tests/working/biccexe.cmd @@ -0,0 +1,18 @@ +@echo off + +IF A%1 == A GOTO :SINTAX +IF A%2 == A GOTO :NOOUTPUT + +icc /Ti+ /W2 /Se /Sd+ /I..\..\include /Fe%2.exe /fohvm.obj /Tp..\..\source\vm\hvm.c /fo%1.obj /Tp%1.c ..\..\libs\icc\harbour.lib ..\..\libs\icc\hbtools.lib +GOTO :END + +:NOOUTPUT +icc /Ti+ /W2 /Se /Sd+ /I..\..\include /Fe%1.exe /fohvm.obj /Tp..\..\source\vm\hvm.c /fo%1.obj /Tp%1.c ..\..\libs\icc\harbour.lib ..\..\libs\icc\hbtools.lib +GOTO :END + +:SINTAX +ECHO syntax: BiccExe Harbour_Output_Filename [Exe_Output_Filename] +ECHO Use Harbour_Output_Filename and Exe_Output_Filename without extensions +ECHO\ + +:END diff --git a/harbour/tests/working/hbicc.cmd b/harbour/tests/working/hbicc.cmd new file mode 100644 index 0000000000..8eccf54f21 --- /dev/null +++ b/harbour/tests/working/hbicc.cmd @@ -0,0 +1,10 @@ +@echo off + +REM From .PRG to .C = Harbour +..\..\bin\harbour %1.prg /n +if errorlevel 1 goto end + +REM From .C to .EXE = BiccEXE +call biccexe %1 %2 + +:end