From db874af7fe21231884f79dcae79935c1f164b018 Mon Sep 17 00:00:00 2001 From: Mizux Seiha Date: Fri, 17 Jul 2020 11:07:49 +0200 Subject: [PATCH] Fix FreeBSD support (Fix #2105) --- ortools/util/fp_utils.h | 2 +- ortools/util/zvector.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ortools/util/fp_utils.h b/ortools/util/fp_utils.h index 569eeddf47..332c31301b 100644 --- a/ortools/util/fp_utils.h +++ b/ortools/util/fp_utils.h @@ -81,7 +81,7 @@ class ScopedFloatingPointEnv { #elif defined(ARCH_K8) CHECK_EQ(0, fegetenv(&fenv_)); excepts &= FE_ALL_EXCEPT; -#ifdef __APPLE__ +#if defined(__APPLE__) || defined(__FreeBSD__) fenv_.__control &= ~excepts; #else // Linux fenv_.__control_word &= ~excepts; diff --git a/ortools/util/zvector.h b/ortools/util/zvector.h index ffd51901eb..60ab555e30 100644 --- a/ortools/util/zvector.h +++ b/ortools/util/zvector.h @@ -14,7 +14,7 @@ #ifndef OR_TOOLS_UTIL_ZVECTOR_H_ #define OR_TOOLS_UTIL_ZVECTOR_H_ -#if defined(__APPLE__) && defined(__GNUC__) +#if ( defined(__APPLE__) || defined(__FreeBSD__) ) && defined(__GNUC__) #include #elif !defined(_MSC_VER) #include