Skip to content

Commit 59a466e

Browse files
committed
otp_net.c: use EAI_OVERFLOW when it is defined
Closes: #1254 Signed-off-by: Sergey Fedorov <vital.had@gmail.com>
1 parent 8e4efd6 commit 59a466e

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/libAtomVM/otp_net.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,10 @@ static term eai_errno_to_term(int err, GlobalContext *glb)
8585
#ifdef HAVE_EXTENDED_EAI_ERRNO
8686
case EAI_BADHINTS:
8787
return globalcontext_make_atom(glb, ATOM_STR("\xB", "eaibadhints"));
88+
#ifdef HAVE_EAI_OVERFLOW
8889
case EAI_OVERFLOW:
8990
return globalcontext_make_atom(glb, ATOM_STR("\xB", "eaioverflow"));
91+
#endif
9092
case EAI_PROTOCOL:
9193
return globalcontext_make_atom(glb, ATOM_STR("\xB", "eaiprotocol"));
9294
case EAI_SYSTEM:

src/platforms/generic_unix/lib/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,10 @@ check_symbol_exists(EAI_BADHINTS "netdb.h" HAVE_EXTENDED_EAI_ERRNO)
102102
if (HAVE_EXTENDED_EAI_ERRNO)
103103
target_compile_definitions(libAtomVM${PLATFORM_LIB_SUFFIX} PUBLIC HAVE_EXTENDED_EAI_ERRNO)
104104
endif()
105+
check_symbol_exists(EAI_OVERFLOW "netdb.h" HAVE_EAI_OVERFLOW)
106+
if (HAVE_EAI_OVERFLOW)
107+
target_compile_definitions(libAtomVM${PLATFORM_LIB_SUFFIX} PUBLIC HAVE_EAI_OVERFLOW)
108+
endif()
105109

106110
if (COVERAGE)
107111
include(CodeCoverage)

0 commit comments

Comments
 (0)