From 7fb3ca66862fa90436393f3448540530ef0a27b4 Mon Sep 17 00:00:00 2001 From: Albert Lee Date: Fri, 16 May 2025 01:53:03 +0000 Subject: [PATCH] core: always define _XPG4_2 and __EXTENSIONS__ on Solaris/illumos --- CMakeLists.txt | 6 ++++++ src/core/core-network.c | 7 ------- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 571c961d1..d50bf1235 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -238,6 +238,12 @@ if(ENABLE_LARGEFILE) add_definitions(-D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -D_LARGE_FILES) endif() +# _XPG4_2 is needed for macros like CMSG_SPACE +# __EXTENSIONS__ is needed for constants like NI_MAXHOST and for struct timeval +if(CMAKE_HOST_SOLARIS) + add_definitions(-D_XPG4_2 -D__EXTENSIONS__) +endif() + # Check for libgcrypt pkg_check_modules(LIBGCRYPT REQUIRED libgcrypt) include_directories(${LIBGCRYPT_INCLUDE_DIRS}) diff --git a/src/core/core-network.c b/src/core/core-network.c index 20dfb7faa..01e9a2792 100644 --- a/src/core/core-network.c +++ b/src/core/core-network.c @@ -28,13 +28,6 @@ #include "config.h" #endif -/* _XPG4_2 is needed on SunOS for macros like CMSG_SPACE */ -/* __EXTENSIONS__ is needed on SunOS for constants like NI_MAXHOST */ -#ifdef __sun -#define _XPG4_2 -#define __EXTENSIONS__ -#endif - #include #include #include