Discussion:
ROOL / Acorn C/C++ compiler define.
(too old to reply)
u***@garethlock.com
2020-04-26 14:51:15 UTC
Permalink
Looking to make Brix compilable for multiple targets. Is there a macro that's defined by the Norcroft / Acorn DDE that identifies it as the platform being used...

Something like...

#ifdef ARM_RISCOS as on GCC??
David Thomas
2020-04-27 20:17:55 UTC
Permalink
Post by u***@garethlock.com
Looking to make Brix compilable for multiple targets. Is there a macro that's defined by the Norcroft / Acorn DDE that identifies it as the platform being used...
Something like...
#ifdef ARM_RISCOS as on GCC??
__riscos
druck
2020-04-27 20:21:11 UTC
Permalink
Post by u***@garethlock.com
Looking to make Brix compilable for multiple targets. Is there a macro that's defined by the Norcroft / Acorn DDE that identifies it as the platform being used...
Something like...
#ifdef ARM_RISCOS as on GCC??
__riscos is defined by Norcroft

---druck
j***@mdfs.net
2020-04-28 01:23:46 UTC
Permalink
Why do you want to know what platform the compiler is being
used on? Surely you want to know what platform the code is
being targetted for.

jgh
druck
2020-04-28 14:21:40 UTC
Permalink
Post by j***@mdfs.net
Why do you want to know what platform the compiler is being
used on? Surely you want to know what platform the code is
being targetted for.
Well you can assume if _riscos is defined you are compiling with
Norcroft for RISC OS, and if _WIN32 is defined you are compiling with
msvc for Windows. But if you are compiling with gcc, it could be
targeted at RISC OS, Windows or Linux. In such as case you can define
your own OS specific symbol with -Dsomething in your makefile.

---druck
Theo
2020-05-12 20:57:57 UTC
Permalink
Post by j***@mdfs.net
Why do you want to know what platform the compiler is being
used on? Surely you want to know what platform the code is
being targetted for.
__riscos is defined by compilers (Norcroft and GCC) that are targeting RISC
OS. It doesn't matter what OS the compiler is running on, the code being
compiled can't tell.

Cross compiling systems (notably autotools) allow build/host/target systems
all to be different so you can distinguish between programs to run on the
build machine and those to run on the machine you're cross-compiling for,
but that's not relevant inside the compiler itself.

Theo

Loading...