Fix FreeBSD 12

FreeBSD 12 changed the type of freelocale to the type defined by
POSIX. Check the FreeBSD version when building for FreeBSD.
This commit is contained in:
Dan McGregor 2018-05-08 14:06:36 -06:00 committed by Victor Zverovich
parent a4e4f74530
commit edbbf7ce6c
2 changed files with 2 additions and 1 deletions

View File

@ -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;

View File

@ -14,6 +14,7 @@
#ifdef _WIN32
# include <windows.h>
#else
# include <sys/param.h> // for FreeBSD version
# include <sys/types.h> // for ssize_t
#endif