From edbbf7ce6cc9c3d6057db94a8ca8b1f0fe29530f Mon Sep 17 00:00:00 2001 From: Dan McGregor Date: Tue, 8 May 2018 14:06:36 -0600 Subject: [PATCH] Fix FreeBSD 12 FreeBSD 12 changed the type of freelocale to the type defined by POSIX. Check the FreeBSD version when building for FreeBSD. --- test/posix-mock-test.cc | 2 +- test/posix-mock.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/test/posix-mock-test.cc b/test/posix-mock-test.cc index 950d11c12d67..b724a6acaab7 100644 --- a/test/posix-mock-test.cc +++ b/test/posix-mock-test.cc @@ -476,7 +476,7 @@ LocaleType newlocale(int category_mask, const char *locale, LocaleType base) { return LocaleMock::instance->newlocale(category_mask, locale, base); } -#if defined(__APPLE__) || defined(__FreeBSD__) +#if defined(__APPLE__) || (defined(__FreeBSD__) && __FreeBSD_version < 1200002) typedef int FreeLocaleResult; #else typedef void FreeLocaleResult; diff --git a/test/posix-mock.h b/test/posix-mock.h index eb575579eef9..9a4c68ffbe34 100644 --- a/test/posix-mock.h +++ b/test/posix-mock.h @@ -14,6 +14,7 @@ #ifdef _WIN32 # include #else +# include // for FreeBSD version # include // for ssize_t #endif