Hi everybody,
I already asked this in a german Amiga developer forum. According to the answers there no common #define seems to exists like for example for Windwos, Linux or even MacOS.
So I hereby wanted to ask what's the official #define to distinguish AOS4 from other AOS versions or derivates (AROS hast its own one)?
Many thanks in advance and
Best Regards
Common #define for AmigaOS4 or AmigaOS in general
- tonyw
- AmigaOS Core Developer
- Posts: 1479
- Joined: Wed Mar 09, 2011 1:36 pm
- Location: Sydney, Australia
Re: Common #define for AmigaOS4 or AmigaOS in general
All the SDK includes use "__amigaos4__"
That's two underscores on each side.
That's two underscores on each side.
cheers
tony
tony
Re: Common #define for AmigaOS4 or AmigaOS in general
@Reth
Morphos - __MORPHOS__
AROS - __AROS__
AmigaOS3 - __amigaos__
Through, on aos4, __amigaos__ will also "eats" fine (because it is amigaos still), so you need to take care about that part when you want os3 code be os3 code. I.e:
Thats how i usually do when want code works on all amiga like oses:
You can of course combine it as you need, like to make some code the same for os4/aros, or for os4/mos. Just keep in mind that on os4 "__amigaos__" define also eats as on os3, so add one more !define
AmigaOS4 - __amigaos4__So I hereby wanted to ask what's the official #define to distinguish AOS4 from other AOS versions or derivates (AROS hast its own one)?
Morphos - __MORPHOS__
AROS - __AROS__
AmigaOS3 - __amigaos__
Through, on aos4, __amigaos__ will also "eats" fine (because it is amigaos still), so you need to take care about that part when you want os3 code be os3 code. I.e:
Code: Select all
#if defined(__amigaos__) && !defined(__amigaos4__)
Code: Select all
#if defined(__amigaos__) && !defined(__amigaos4__) // OS3
...os3code...
#elif (__amigaos4__) // os4
..os4code..
#elif (__MORPHOS__) // mos
..moscode..
#elif (__AROS__) // aros
..aroscode
#endif