From 51fcd871028d1bb5f0a3b541e823cefd2f2aba63 Mon Sep 17 00:00:00 2001 From: Adam Langley Date: Thu, 2 Oct 2014 15:35:35 -0700 Subject: [PATCH] Fix NaCl build. NaCl defines _POSIX_C_SOURCE on the command line for some reason, thus we have to be defensive about defining it. Change-Id: Icbc8afcb1ac0e0ca23b788b11ea911c3f55a8b7f Reviewed-on: https://boringssl-review.googlesource.com/1891 Reviewed-by: David Benjamin Reviewed-by: Adam Langley --- crypto/bio/bio_test.c | 2 ++ crypto/lhash/lhash_test.c | 2 ++ crypto/mem.c | 2 ++ crypto/time_support.c | 2 ++ 4 files changed, 8 insertions(+) diff --git a/crypto/bio/bio_test.c b/crypto/bio/bio_test.c index fd88b55f..86363f9c 100644 --- a/crypto/bio/bio_test.c +++ b/crypto/bio/bio_test.c @@ -12,7 +12,9 @@ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#if !defined(_POSIX_C_SOURCE) #define _POSIX_C_SOURCE 201410L +#endif #include diff --git a/crypto/lhash/lhash_test.c b/crypto/lhash/lhash_test.c index e47e96fa..cf5e99b6 100644 --- a/crypto/lhash/lhash_test.c +++ b/crypto/lhash/lhash_test.c @@ -12,7 +12,9 @@ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#if !defined(_POSIX_C_SOURCE) #define _POSIX_C_SOURCE 201410L +#endif #include #include diff --git a/crypto/mem.c b/crypto/mem.c index b16b3104..11ef3352 100644 --- a/crypto/mem.c +++ b/crypto/mem.c @@ -53,7 +53,9 @@ * copied and put under another distribution licence * [including the GNU Public Licence.] */ +#if !defined(_POSIX_C_SOURCE) #define _POSIX_C_SOURCE 201410L /* needed for strdup, snprintf, vprintf etc */ +#endif #include diff --git a/crypto/time_support.c b/crypto/time_support.c index 4537e82b..bbfe3036 100644 --- a/crypto/time_support.c +++ b/crypto/time_support.c @@ -55,7 +55,9 @@ * (eay@cryptsoft.com). This product includes software written by Tim * Hudson (tjh@cryptsoft.com). */ +#if !defined(_POSIX_C_SOURCE) #define _POSIX_C_SOURCE 201410L /* for gmtime_r */ +#endif #include