I am working on AS / 400, which is sometimes not POSIX. We also need to compile our code on UNIX. We have a problem with something simple: #include.
In AS / 400, we need to write:
#include "* LIBL / H / MYLIB"
On UNIX, we need to write
#include "MYLIB.H"
Right now, we have this (ugly) block at the top of every C / C ++ file:
#ifndef IS_AS400
#include "* LIBL / H / MYLIB"
/ * others here * /
#else
#include "MYLIB.H"
/ * others here * /
#endif
We need a unified macro. Is it possible? I donβt know how to write it down.
Ideally, the resulting syntax would be as follows:
SAFE_INCLUDE ("MYLIB") which will expand correctly on every platform.
Please inform.
source share