aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJohn Levon <john.levon@joyent.com>2020-01-20 02:48:03 -0800
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2020-01-22 23:24:20 +0100
commit4efeeb73f74194ae81b3243cbfe6cbf5fdbb29d3 (patch)
tree99577a9e8cf93c2cfd13853d8586d61d2b74a821
parenta2bf440057d2fd9ed1bf29a42d253efbf08db4ce (diff)
downloadsparse-4efeeb73f74194ae81b3243cbfe6cbf5fdbb29d3.tar.gz
pre-define __unix__ and friends
GCC defines these, so should we. Signed-off-by: John Levon <john.levon@joyent.com> Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
-rw-r--r--lib.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib.c b/lib.c
index 2de2887f..f15e4d99 100644
--- a/lib.c
+++ b/lib.c
@@ -1402,6 +1402,12 @@ static void predefined_macros(void)
if (arch_target->predefine)
arch_target->predefine(arch_target);
+ if (arch_os >= OS_UNIX) {
+ predefine("__unix__", 1, "1");
+ predefine("__unix", 1, "1");
+ predefine_nostd("unix");
+ }
+
if (arch_os == OS_SUNOS) {
predefine("__sun__", 1, "1");
predefine("__sun", 1, "1");