aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichał Łyszczek <michal.lyszczek@bofc.pl>2018-10-12 16:59:12 +0200
committerMichał Łyszczek <michal.lyszczek@bofc.pl>2018-10-12 17:00:35 +0200
commit3b084bff1d27678735e56e47867a79e2e59ad4d5 (patch)
tree9d3bbad9a8cbbe2004f47d7b77634aad292a5a8b
parentd2a0b2ee2969b2f3cf0b5f6d9bf1e0f7362e11f1 (diff)
downloadembedlog-3b084bff1d27678735e56e47867a79e2e59ad4d5.tar.gz
embedlog-3b084bff1d27678735e56e47867a79e2e59ad4d5.tar.bz2
embedlog-3b084bff1d27678735e56e47867a79e2e59ad4d5.zip
add: feature test macros for ONLCR for different systems
-rw-r--r--src/el-private.h18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/el-private.h b/src/el-private.h
index 0b03e4f..2f1dbf7 100644
--- a/src/el-private.h
+++ b/src/el-private.h
@@ -108,8 +108,10 @@
# endif
#endif
-/* ONLCR flag on FreeBSD needs __BSD_VISIBLE defined and solaris
- * need __EXTENSIONS__
+/* ONLCR flag is quite messy, different systems needs different
+ * definition for it to be seen by source, and some systems don't
+ * need any definition by default. This is short (and surely
+ * incomplete) list of OSes that needs it for proper compilation
*/
#if ENABLE_OUT_TTY
# if HAVE_TERMIOS_H
@@ -117,10 +119,22 @@
# ifndef __BSD_VISIBLE
# define __BSD_VISIBLE 1
# endif
+# elif __NetBSD__
+# ifndef _NETBSD_SOURCE
+# define _NETBSD_SOURCE 1
+# endif
# elif sun || __sun
# ifndef __EXTENSIONS__
# define __EXTENSIONS__ 1
# endif
+# elif __QNX__ || __QNXNTO__
+# ifndef _QNX_SOURCE
+# define _QNX_SOURCE 1
+# endif
+# elif __DragonFly__ || __minix
+# ifndef _XOPEN_SOURCE
+# define _XOPEN_SOURCE 500
+# endif
# endif
# endif
#endif