Porting GDC to QNX

Anders F Björklund afb at algonet.se
Fri Mar 30 05:55:31 PDT 2007


Sheff wrote:
> I think I understood what's the problem, the values of POSIX constants are different in linux and QNX (i.e O_CREAT, MAP_ANON, etc ), but in phobos they're defined like in linux, for example:
> In phobos O_CREAT defined like:
> const int O_CREAT = 0100; //0x64
> In linux fcntl.h header:
> #define  O_CREAT 0100 //0x64
> but in QNX fcntl.h header it's defined like this:
> #define  O_CREAT 0400 //0x100
> 0x64 != 0x100, so file creation always fails, so do other system calls.
> What shall I do about it ? I don't want to manually redefine all POSIX constants...

That only applies to DMD's (which only supports Linux anyway) Phobos,
but not to GDC - it uses autoconf to generate those gPhobos constants.

For instance, on Mac OS X we have:
#define        O_CREAT         0x0200

Take a look at the programs in d/phobos/config, for all the details.
You need to create the frag-gen, frag-math and frag-unix configs...

--anders



More information about the Digitalmars-d mailing list