Skip to content

Commit

Permalink
Explicly define NI_MAXHOST and NI_MAXSERV
Browse files Browse the repository at this point in the history
They should come with <netdb.h> if the appropriate feature test macros
are defined. But defining the right ones (e.g. _POSIX_C_SOURCE with
value 200112L or even 200809L), ideally in configure.ac, requires more
investigation, given that different macros are spread around the
codebase.

This change is aimed at quickly fixing the build on macOS.
  • Loading branch information
giacomini committed Oct 1, 2024
1 parent 1b29270 commit a405923
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/socklib/ipv6sock.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@
# define _POSIX_SOURCE 1
#endif

#ifndef NI_MAXHOST
# define NI_MAXHOST 1025
#endif
#ifndef NI_MAXSERV
# define NI_MAXSERV 32
#endif

#include <sys/types.h>
#include <netdb.h>
#include <sys/socket.h>
Expand Down

0 comments on commit a405923

Please sign in to comment.