Skip to content

Commit 0d6a00e

Browse files
committed
Merge pull request #1255 from barracuda156/darwin
otp_net.c: use EAI_OVERFLOW when it is defined Closes: #1254 These changes are made under both the "Apache 2.0" and the "GNU Lesser General Public License 2.1 or later" license terms (dual license). SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later
2 parents 09783b4 + 59a466e commit 0d6a00e

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)