[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tlsdate/master] Use the strchrnul() replacement on FreeBSD versions that need it



commit bf91ea96c63e885c0800bbc856459052a4f69207
Author: Fabian Keil <fk@xxxxxxxxxxxxx>
Date:   Thu Nov 21 14:05:54 2013 +0100

    Use the strchrnul() replacement on FreeBSD versions that need it
    
    This gets tlsdate and tlsdate-helper working on FreeBSD 9.2-RELEASE.
---
 configure.ac   |    3 +++
 src/conf.c     |    6 ++++++
 src/include.am |    6 ++++++
 3 files changed, 15 insertions(+)

diff --git a/configure.ac b/configure.ac
index 04ea89a..cdecdd5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -160,6 +160,9 @@ AC_CHECK_TYPES([struct rtc_time], [], [], [
 #endif
 ])
 
+AC_CHECK_FUNCS([strchrnul])
+AM_CONDITIONAL(HAVE_STRCHRNUL, [test "x${ac_cv_func_strchrnul}" = xyes])
+
 AC_CHECK_FUNCS([strnlen])
 AM_CONDITIONAL(HAVE_STRNLEN, [test "x${ac_cv_func_strnlen}" = xyes])
 
diff --git a/src/conf.c b/src/conf.c
index 6182650..27c56d1 100644
--- a/src/conf.c
+++ b/src/conf.c
@@ -27,6 +27,12 @@
 #include "src/common/android.h" // XXX: Dirty hack - make this more generic later
 #endif
 
+#ifdef TARGET_OS_FREEBSD
+#ifndef HAVE_STRCHRNUL
+#include "src/common/android.h" // XXX: Dirty hack - make this more generic later
+#endif
+#endif
+
 #ifdef HAVE_ANDROID
 #include "src/common/android.h"
 #endif
diff --git a/src/include.am b/src/include.am
index 953bcd6..259d618 100644
--- a/src/include.am
+++ b/src/include.am
@@ -35,6 +35,9 @@ bin_PROGRAMS+= src/tlsdate-helper
 
 src_conf_unittest_SOURCES = src/conf.c
 src_conf_unittest_SOURCES+= src/conf-unittest.c
+if !HAVE_STRCHRNUL
+src_conf_unittest_SOURCES+= src/common/android.c
+endif
 check_PROGRAMS+= src/conf_unittest
 noinst_PROGRAMS+= src/conf_unittest
 endif
@@ -222,6 +225,9 @@ src_proxy_bio_unittest_SOURCES = src/proxy-bio.c
 src_proxy_bio_unittest_SOURCES+= src/proxy-bio-unittest.c
 src_proxy_bio_unittest_SOURCES+= src/test-bio.c
 src_proxy_bio_unittest_SOURCES+= src/util.c
+if !HAVE_STRCHRNUL
+src_proxy_bio_unittest_SOURCES+= src/common/android.c
+endif
 check_PROGRAMS+= src/proxy-bio_unittest
 noinst_PROGRAMS+= src/proxy-bio_unittest
 endif



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits