From 99a3887d66885204ed8fa13405ae04b632dc8d33 Mon Sep 17 00:00:00 2001 From: Maya Rashish Date: Sat, 23 Sep 2017 06:57:16 +0300 Subject: [PATCH] Define __EXT_POSIX2 for QNX POSIX 1003.2 extension is necessary for getopt interface. Reported here [1] (not mine, I can't test) [1]: https://mail-index.netbsd.org/pkgsrc-users/2017/09/20/msg025601.html Closes: #563 (cherry-pick) --- evconfig-private.h.cmake | 5 +++++ evconfig-private.h.in | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/evconfig-private.h.cmake b/evconfig-private.h.cmake index 32f04794..1adf9c03 100644 --- a/evconfig-private.h.cmake +++ b/evconfig-private.h.cmake @@ -32,4 +32,9 @@ /* Define to 1 if you need to in order for `stat' and other things to work. */ #cmakedefine _POSIX_SOURCE 1 +/* Enable POSIX.2 extensions on QNX for getopt */ +#ifdef __QNX__ +#cmakedefine __EXT_POSIX2 1 +#endif + #endif diff --git a/evconfig-private.h.in b/evconfig-private.h.in index 7b3dfdb1..8cd64787 100644 --- a/evconfig-private.h.in +++ b/evconfig-private.h.in @@ -45,4 +45,11 @@ #undef _POSIX_SOURCE #endif +/* Enable POSIX.2 extensions on QNX for getopt */ +#ifdef __QNX__ +# ifndef __EXT_POSIX2 +# define __EXT_POSIX2 +# endif +#endif + #endif