-D_XOPEN_SOURCE=600 is necessary for struct sockaddr_in6.
if test "x$GCC" = xyes; then
CFLAGS="-std=c89 -pedantic -Wall -Wextra -Werror $CFLAGS"
CFLAGS="-Wno-error=int-to-pointer-cast $CFLAGS"
- CPPFLAGS="-D_XOPEN_SOURCE=500 $CPPFLAGS"
+ CPPFLAGS="-D_XOPEN_SOURCE=600 $CPPFLAGS"
# Additional hardening flags.
CFLAGS="-fPIE -fstack-protector-all -Wformat -Werror=format-security $CFLAGS"
CPPFLAGS="-D_FORTIFY_SOURCE=2 $CPPFLAGS"
#include <limits.h>
#include <netdb.h>
#include <poll.h>
+#include <sys/socket.h>
#include <unistd.h>
#include <gnutls/x509.h>
#ifdef DEBUG
fprintf(stderr, "%-12s:%-4d ", file, line);
#endif
- fprintf(stderr, "[%s] [%d] ", level_string, (int)pthread_self());
+ fprintf(stderr, "[%s] [%ld] ", level_string, (long)pthread_self());
va_start(ap, format);
vfprintf(stderr, format, ap);
va_end(ap);
#include <arpa/inet.h>
#include <assert.h>
#include <errno.h>
+#include <limits.h>
+#include <netinet/in.h>
#include <pthread.h>
#include <signal.h>
+#include <stdint.h>
#include <sys/socket.h>
#include <sys/stat.h>
#include <sys/types.h>
-#include <unistd.h>
-#include <limits.h>
#if GNUTLS_VERSION_NUMBER <= 0x020b00
/* Necessary for GnuTLS when used with threads. */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <unistd.h>
#include <gnutls/gnutls.h>