mirror of
https://github.com/status-im/miniupnp.git
synced 2025-02-12 05:56:53 +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 += -ansi
|
||||||
CFLAGS += -Wall -W
|
CFLAGS += -Wall -W
|
||||||
CFLAGS += -D_BSD_SOURCE
|
CFLAGS += -D_BSD_SOURCE
|
||||||
CFLAGS += -D_POSIX_C_SOURCE=1
|
CFLAGS += -D_POSIX_C_SOURCE=200112L
|
||||||
|
|
||||||
LDFLAGS = -levent
|
LDFLAGS = -levent
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ endif (NO_GETADDRINFO)
|
|||||||
|
|
||||||
if (NOT WIN32)
|
if (NOT WIN32)
|
||||||
add_definitions (-DMINIUPNPC_SET_SOCKET_TIMEOUT)
|
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)
|
else (NOT WIN32)
|
||||||
add_definitions (-D_WIN32_WINNT=0x0501) # XP or higher for getnameinfo and friends
|
add_definitions (-D_WIN32_WINNT=0x0501) # XP or higher for getnameinfo and friends
|
||||||
endif (NOT WIN32)
|
endif (NOT WIN32)
|
||||||
|
@ -35,7 +35,7 @@ CFLAGS += -W -Wstrict-prototypes
|
|||||||
CFLAGS += -fno-common
|
CFLAGS += -fno-common
|
||||||
CFLAGS += -DMINIUPNPC_SET_SOCKET_TIMEOUT
|
CFLAGS += -DMINIUPNPC_SET_SOCKET_TIMEOUT
|
||||||
CFLAGS += -DMINIUPNPC_GET_SRC_ADDR
|
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
|
CFLAGS += -ansi
|
||||||
# -DNO_GETADDRINFO
|
# -DNO_GETADDRINFO
|
||||||
INSTALL = install
|
INSTALL = install
|
||||||
|
@ -38,6 +38,7 @@
|
|||||||
#include <net/if.h>
|
#include <net/if.h>
|
||||||
#include <netdb.h>
|
#include <netdb.h>
|
||||||
#define closesocket close
|
#define closesocket close
|
||||||
|
#include <strings.h>
|
||||||
#endif /* #else _WIN32 */
|
#endif /* #else _WIN32 */
|
||||||
#ifdef __GNU__
|
#ifdef __GNU__
|
||||||
#define MAXHOSTNAMELEN 64
|
#define MAXHOSTNAMELEN 64
|
||||||
|
Loading…
x
Reference in New Issue
Block a user