mirror of
https://github.com/status-im/miniupnp.git
synced 2025-01-31 00:26:48 +00:00
Fix _POSIX_C_SOURCE definition
Current code makes use of `snprintf` function defined in C99 standard but _POSIX_C_SOURCE is set to "1" which is not correct. To access C99 definitions, this macro should be set to at least "200112L". Also, `strncasecmp` function is being used but corresponding <strings.h> header is not being included in miniwget.c. Changes have been tested on FreeBSD 10.1 amd64 with default compiler (Clang).
This commit is contained in:
parent
d4bf4c7572
commit
c490b42547
@ -10,7 +10,7 @@ CFLAGS += -fPIC
|
||||
CFLAGS += -ansi
|
||||
CFLAGS += -Wall -W
|
||||
CFLAGS += -D_BSD_SOURCE
|
||||
CFLAGS += -D_POSIX_C_SOURCE=1
|
||||
CFLAGS += -D_POSIX_C_SOURCE=200112L
|
||||
|
||||
LDFLAGS = -levent
|
||||
|
||||
|
@ -30,7 +30,7 @@ endif (NO_GETADDRINFO)
|
||||
|
||||
if (NOT WIN32)
|
||||
add_definitions (-DMINIUPNPC_SET_SOCKET_TIMEOUT)
|
||||
add_definitions (-D_BSD_SOURCE -D_POSIX_C_SOURCE=1)
|
||||
add_definitions (-D_BSD_SOURCE -D_POSIX_C_SOURCE=200112L)
|
||||
else (NOT WIN32)
|
||||
add_definitions (-D_WIN32_WINNT=0x0501) # XP or higher for getnameinfo and friends
|
||||
endif (NOT WIN32)
|
||||
|
@ -35,7 +35,7 @@ CFLAGS += -W -Wstrict-prototypes
|
||||
CFLAGS += -fno-common
|
||||
CFLAGS += -DMINIUPNPC_SET_SOCKET_TIMEOUT
|
||||
CFLAGS += -DMINIUPNPC_GET_SRC_ADDR
|
||||
CFLAGS += -D_BSD_SOURCE -D_POSIX_C_SOURCE=1
|
||||
CFLAGS += -D_BSD_SOURCE -D_POSIX_C_SOURCE=200112L
|
||||
CFLAGS += -ansi
|
||||
# -DNO_GETADDRINFO
|
||||
INSTALL = install
|
||||
|
@ -38,6 +38,7 @@
|
||||
#include <net/if.h>
|
||||
#include <netdb.h>
|
||||
#define closesocket close
|
||||
#include <strings.h>
|
||||
#endif /* #else _WIN32 */
|
||||
#ifdef __GNU__
|
||||
#define MAXHOSTNAMELEN 64
|
||||
|
Loading…
x
Reference in New Issue
Block a user