aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2020-06-28 14:51:07 +0200
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2020-07-13 17:49:55 +0200
commitf57ae22a393b39dc80467d44cee31498016b5f0d (patch)
tree482a573786bb2d3bf4cfafedad1619f99d0b287e
parent7fffea101f878d7040fec4347d52544f6994b042 (diff)
downloadsparse-f57ae22a393b39dc80467d44cee31498016b5f0d.tar.gz
predefine: add __linux__ & __linux
These are already defined in cgcc but not yet by sparse itself. So, add them now. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
-rw-r--r--predefine.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/predefine.c b/predefine.c
index d05b1018..0e9f73eb 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;
}
}