From 41db60c6becd625bedf6961b9eda453b2b6c1bed Mon Sep 17 00:00:00 2001 From: Martijn Dekker Date: Wed, 20 Apr 2022 20:32:35 +0200 Subject: [PATCH] Restore build on QNX Neutrino 6.5.0 (re: a874f8c1) The QNX system at polarhome.com seems to be back up, at least temporarily, though polarhome has officially shut down. This allowed me to test ksh on QNX again, discovering that the build was broken since reworking the standards macros handling. src/lib/libast/features/standards: - On QNX, define _QNX_SOURCE=1 to enable all extensions and _FILE_OFFSET_BITS=64 to enable large file support with standard library function names. --- src/cmd/ksh93/README | 2 +- src/lib/libast/features/standards | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/cmd/ksh93/README b/src/cmd/ksh93/README index 0af651c48..b41a23f84 100644 --- a/src/cmd/ksh93/README +++ b/src/cmd/ksh93/README @@ -279,7 +279,7 @@ failures (crashes, and/or important functionality does not work). * NetBSD 9.2 on x86_64 * OpenBSD 6.8 on x86_64 OpenBSD 7.0 on x86_64 -** QNX 6.5.0 on i386 +* QNX Neutrino 6.5.0 on i386 * Solaris 11.4 (gcc) on x86_64 Solaris 11.4 (Solaris Studio 12.5 cc) on x86_64 * UnixWare 7.1.4 on x86 diff --git a/src/lib/libast/features/standards b/src/lib/libast/features/standards index 6f3b000cf..68e21c32e 100644 --- a/src/lib/libast/features/standards +++ b/src/lib/libast/features/standards @@ -165,6 +165,22 @@ elif tst note{ GNU (glibc) or Cygwin }end compile{ #endif #define basename basename /* avoid string.h defining this in conflict with AST basename(3) */ } +elif tst note{ QNX }end compile{ + /* + * QNX Neutrino, tested on version 6.5.0 as of April 2022. + */ + #define _QNX_SOURCE 1 + #if !__QNX__ + #error not QNX + #endif + }end { + #ifndef _QNX_SOURCE + #define _QNX_SOURCE 1 + #endif + #ifndef _FILE_OFFSET_BITS + #define _FILE_OFFSET_BITS 64 + #endif + } elif tst note{ _ALL_SOURCE & _POSIX_SOURCE & _POSIX_C_SOURCE & _XOPEN_SOURCE & __EXTENSIONS__ works }end compile{ #define _ALL_SOURCE 1 #define _POSIX_SOURCE 1