Prof A Olowofoyeku (The African Chief) wrote:
On 17 Oct 2004 at 19:12, I wrote:
Compiles okay under Mingw. My initial tests (a program that uses the Crt unit) throws up this:
"In file included from d:/mingw/lib/gcclib/mingw32/3.2.3/units/crtc.c:46: d:/mingw/include/unistd.h:23: error: syntax error before "off_t"
[...]
Looking at crtc.c, I find this: #ifdef __MINGW32__ #undef _NO_OLDNAMES #define _NO_OLDNAMES 1 #endif
Looking at sys/types.h, I find this: #ifndef _NO_OLDNAMES typedef _off_t off_t; #endif
So there seems to a problem here ...
Looks like a bug in the mingw headers. If `ftruncate' in unistd.h uses `off_t', but the other headers don't declare this type (if `_NO_OLDNAMES' is set), there's something wrong.
BTW, according to the comment in crtc.c, `_NO_OLDNAMES' is defined in order to prevent stdlib.h from declaring a `beep' function which would conflict with PDCurses' one. Since `beep' belongs to the curses standard, it would be a bug for stdlib.h to define its own version. If this bug is fixed by now, we could remove `_NO_OLDNAMES'. This would avoid the first bug, though not really solve it.
You might report this to the mingw maintainers.
BTW, AFAIK, there weren't any related changes in GPC or CRT recently, so I suppose something was changed in the mingw headers.
Frank