1
0
mirror of https://git.zap.org.au/git/trader.git synced 2024-07-21 16:14:14 -04:00

Use a better check for Solaris (SunOS 5.x)

The __sun__ macro is not always defined by Oracle Solaris Studio, but
__sun is, as it is in GCC and Clang.  By itself, __sun__ also matches the
very obsolete SunOS 4.x BSD-based operating system, hence the need for
__SVR4 as well.

See https://web.archive.org/web/20180221212835/http://nadeausoftware.com/articles/2012/01/c_c_tip_how_use_compiler_predefined_macros_detect_operating_system
for more information on operating system macro checks.
This commit is contained in:
John Zaitseff 2018-08-04 18:03:33 +10:00
parent 2d6a339fb1
commit 192b749018

View File

@ -45,11 +45,11 @@
#if ! defined(_XOPEN_SOURCE) || _XOPEN_SOURCE < 700
# undef _XOPEN_SOURCE
# if ! defined(__sun__)
# define _XOPEN_SOURCE 700 // Use SUSv4 where possible
# if defined(__sun) && defined(__SVR4)
# define _XOPEN_SOURCE 600 // Use SUSv3 on SunOS 5.x
# define __EXTENSIONS__ 1 // ... with Solaris extensions
# else
# define _XOPEN_SOURCE 600 // Except on SunOS 5.x
# define __EXTENSIONS__ 1 // ... but use Solaris extensions
# define _XOPEN_SOURCE 700 // Use SUSv4 everywhere else
# endif
#endif