Frank Heckenbach a écrit:
I have uploaded a new beta version of GPC to http://www.gnu-pascal.de/beta/.
I have compiled djgpp versions for gcc-3.2.3 and gcc-3.3.3 no error, two tests skipped as usual (no long real in djgpp, no german locale on my machine) they are uploaded as usual into
http://www.gnu-pascal.de/contrib/maurice/
Still the same problem of CPP_PREDEFINES with gcc-3.3.3 so I recommend still the use of gcc-3.2.3 based gpc (as the Chief with mingw)
For reference I have also uploaded the files gcc323s2.zip and gpc333s2.zip modified for gpc compilation which I have used (all diffs are inside and instructions are on the top level readme.gpc)
The only problem was with gcc-3.3.3 in the TARGET_OS_CPP_BUILTINS() defined in gcc/config/i386/djgpp.h as modified for djgpp in gcc333s2.zip the hunk ----------------------------------------------- @@ -85,8 +92,13 @@ #define TARGET_OS_CPP_BUILTINS() \ do \ { \ + if (!flag_iso) \ + builtin_define_with_int_value ("DJGPP",2); \ + builtin_define_with_int_value ("__DJGPP",2); \ + builtin_define_with_int_value ("__DJGPP__",2); \ builtin_define_std ("MSDOS"); \ builtin_define_std ("GO32"); \ + builtin_define_std ("unix"); \ builtin_assert ("system=msdos"); \ } \ while (0) ------------------------------------------------------------- used the function builtin_define_with_int_value() which was unknown during gpc compilation and made it to fail In fact this function is prototyped and defined in c-common.c While compiling gcc, c-common.o is linked into, which makes success, but this is not the case for gpc. As a quick work around, I changed this hunk into ------------------------------------------------------------- @@ -85,8 +92,13 @@ #define TARGET_OS_CPP_BUILTINS() \ do \ { \ + if (!flag_iso) \ + builtin_define ("DJGPP=2"); \ + builtin_define ("__DJGPP=2"); \ + builtin_define ("__DJGPP__=2"); \ builtin_define_std ("MSDOS"); \ builtin_define_std ("GO32"); \ + builtin_define_std ("unix"); \ builtin_assert ("system=msdos"); \ } \ while (0) --------------------------------------------------------------- which works. I do not understand the difference, but I checked that this function builtin_define_with_int_value() is a gooddity used only inside c-common.c and called from inside the various config header files only by djgpp.h So probably for the time going you can ignore this issue, I will take care of it only for djgpp.
I made a quick look with the new gp.exe with 3.2.3 DJGPP and __DJGPP__ are defined (but not __DJGPP) with 3.3.3 __DJGPP and __DJGPP__ are defined (but not DJGPP) (this is what results from the above hunk since flag_iso=1 in p/lang.c).
but in a C program all three are defined, so there is a kwirk elsewhere in both cases
Maurice