Skip to content

Commit 7c01892

Browse files
EGuesnetkevinAlbs
authored andcommitted
Fix __ss_family build issue on AIX6.1 (#592)
1 parent 9239142 commit 7c01892

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed

src/libmongoc/CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,13 @@ if (NOT ENABLE_ICU STREQUAL OFF)
398398
endif()
399399
endif()
400400

401+
CHECK_STRUCT_HAS_MEMBER("struct sockaddr_storage" ss_family "sys/socket.h" MONGOC_HAVE_SS_FAMILY)
402+
if (NOT MONGOC_HAVE_SS_FAMILY)
403+
set (MONGOC_HAVE_SS_FAMILY 0)
404+
else ()
405+
set (MONGOC_HAVE_SS_FAMILY 1)
406+
endif ()
407+
401408
configure_file (
402409
"${PROJECT_SOURCE_DIR}/src/mongoc/mongoc-config.h.in"
403410
"${PROJECT_BINARY_DIR}/src/mongoc/mongoc-config.h"

src/libmongoc/src/mongoc/mongoc-config.h.in

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,15 @@
370370
# undef MONGOC_ENABLE_ICU
371371
#endif
372372

373+
/*
374+
* Set if struct sockaddr_storage has __ss_family (instead of ss_family)
375+
*/
376+
377+
#define MONGOC_HAVE_SS_FAMILY @MONGOC_HAVE_SS_FAMILY@
378+
379+
#if MONGOC_HAVE_SS_FAMILY != 1
380+
# undef MONGOC_HAVE_SS_FAMILY
381+
#endif
373382

374383
/*
375384
* NOTICE:

src/libmongoc/src/mongoc/mongoc-socket.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
#include <sys/un.h>
3939
#endif
4040

41-
#if defined(_AIX) && !defined(HAVE_SA_SS_FAMILY)
41+
#if defined(_AIX) && !defined(MONGOC_HAVE_SS_FAMILY)
4242
# define ss_family __ss_family
4343
#endif
4444

0 commit comments

Comments
 (0)