[PATCH 3/9] predefine: add __linux__ & __linux

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

 



These are already defined in cgcc but not yet by sparse
itself. So, add them now.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@xxxxxxxxx>
---
 predefine.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/predefine.c b/predefine.c
index d05b1018fdce..0e9f73eb2340 100644
--- a/predefine.c
+++ b/predefine.c
@@ -216,10 +216,16 @@ void predefined_macros(void)
 		predefine_nostd("unix");
 	}
 
-	if (arch_os == OS_SUNOS) {
+	switch (arch_os) {
+	case OS_LINUX:
+		predefine("__linux__", 1, "1");
+		predefine("__linux", 1, "1");
+		break;
+	case OS_SUNOS:
 		predefine("__sun__", 1, "1");
 		predefine("__sun", 1, "1");
 		predefine_nostd("sun");
 		predefine("__svr4__", 1, "1");
+		break;
 	}
 }
-- 
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