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