]> ruderich.org/simon Gitweb - tlsproxy/tlsproxy.git/commitdiff
Fix compile on FreeBSD.
authorSimon Ruderich <simon@ruderich.org>
Mon, 2 Dec 2013 04:54:00 +0000 (05:54 +0100)
committerSimon Ruderich <simon@ruderich.org>
Mon, 2 Dec 2013 04:54:00 +0000 (05:54 +0100)
-D_XOPEN_SOURCE=600 is necessary for struct sockaddr_in6.

configure.ac
src/connection.c
src/log.c
src/tlsproxy.c
src/tlsproxy.h

index 1d3592a0275eeb2926435f5ade18ba062f6e29bd..24f2c1fd3e1d1bfb037a12226f5e5e731a683b54 100644 (file)
@@ -36,7 +36,7 @@ CC="$PTHREAD_CC"
 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"
index 793e4680ebfc6c9312498298a6a4737e5513f2a8..ad7298a876033dd3b37e7303901506c9f4b9b463 100644 (file)
@@ -26,6 +26,7 @@
 #include <limits.h>
 #include <netdb.h>
 #include <poll.h>
+#include <sys/socket.h>
 #include <unistd.h>
 
 #include <gnutls/x509.h>
index 402e82dbdf0472e18c78b2c08fffeb00accbbe3f..678b5686c2ffad0dd7c6d8955b6712dc8e22d647 100644 (file)
--- a/src/log.c
+++ b/src/log.c
@@ -52,7 +52,7 @@ void log_message(int level, const char *file, int line, const char *format, ...)
 #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);
index 160a236cbb895e540edeae3411738c33dcc849b0..fa570641b264f87e738f81862f03439bac05b388 100644 (file)
 #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. */
index 4664428fe862be1f5ce02bde348399b037667b8d..15c5a51b8fcdfbcd6f0d230ed653f478f2db7a3b 100644 (file)
@@ -25,6 +25,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <unistd.h>
 
 #include <gnutls/gnutls.h>