[PATCH 7/9] arch: add predefines for OS identification

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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




[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux