From f2e8010d95cbc220f8a05c597f5a81ed2339f71c Mon Sep 17 00:00:00 2001 From: Dietmar Scheidl Date: Tue, 18 Jan 2022 07:35:31 +0100 Subject: [PATCH] fix building on AIX and SunOS (#1031) --- CMakeLists.txt | 3 +++ fmacros.h | 2 ++ 2 files changed, 5 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 122112b..fe6720b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -63,6 +63,9 @@ IF(WIN32 OR MINGW) ELSEIF(CMAKE_SYSTEM_NAME MATCHES "FreeBSD") TARGET_LINK_LIBRARIES(hiredis PUBLIC m) TARGET_LINK_LIBRARIES(hiredis_static PUBLIC m) +ELSEIF(CMAKE_SYSTEM_NAME MATCHES "SunOS") + TARGET_LINK_LIBRARIES(hiredis PUBLIC socket) + TARGET_LINK_LIBRARIES(hiredis_static PUBLIC socket) ENDIF() TARGET_INCLUDE_DIRECTORIES(hiredis PUBLIC $ $) diff --git a/fmacros.h b/fmacros.h index 3227faa..754a53c 100644 --- a/fmacros.h +++ b/fmacros.h @@ -1,8 +1,10 @@ #ifndef __HIREDIS_FMACRO_H #define __HIREDIS_FMACRO_H +#ifndef _AIX #define _XOPEN_SOURCE 600 #define _POSIX_C_SOURCE 200112L +#endif #if defined(__APPLE__) && defined(__MACH__) /* Enable TCP_KEEPALIVE */