Predefine macros like '__OpenBSD__', ... for the three BSDs, CygWin and Darwin (those for Linus and SunOS were already defined). Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@xxxxxxxxx> --- predefine.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/predefine.c b/predefine.c index 7583b1afc32e..0f36f7ef56d2 100644 --- a/predefine.c +++ b/predefine.c @@ -217,10 +217,29 @@ void predefined_macros(void) } switch (arch_os) { + case OS_CYGWIN: + predefine("__CYGWIN__", 1, "1"); + if (arch_m64 == ARCH_LP32) + predefine("__CYGWIN32__", 1, "1"); + break; + case OS_DARWIN: + predefine("__APPLE__", 1, "1"); + predefine("__APPLE_CC__", 1, "1"); + predefine("__MACH__", 1, "1"); + break; + case OS_FREEBSD: + predefine("__FreeBSD__", 1, "1"); + break; case OS_LINUX: predefine("__linux__", 1, "1"); predefine("__linux", 1, "1"); break; + case OS_NETBSD: + predefine("__NetBSD__", 1, "1"); + break; + case OS_OPENBSD: + predefine("__OpenBSD__", 1, "1"); + break; case OS_SUNOS: predefine("__sun__", 1, "1"); predefine("__sun", 1, "1"); -- 2.27.0