diff --git a/ccutil/scanutils.cpp b/ccutil/scanutils.cpp index f49c6f63c6..fca4f8192f 100644 --- a/ccutil/scanutils.cpp +++ b/ccutil/scanutils.cpp @@ -19,6 +19,10 @@ // See the License for the specific language governing permissions and // limitations under the License. +#ifdef HAVE_CONFIG_H +#include "config_auto.h" +#endif + #include #include #include @@ -34,7 +38,7 @@ #include "tprintf.h" // workaround for "'off_t' was not declared in this scope" with -std=c++11 -#if !defined(off_t) && !defined(__APPLE__) && !defined(__CYGWIN__) +#if !defined(HAVE_OFF_T) typedef long off_t; #endif // off_t diff --git a/cmake/Configure.cmake b/cmake/Configure.cmake index 37ea6a1009..fae2c9a5b0 100644 --- a/cmake/Configure.cmake +++ b/cmake/Configure.cmake @@ -105,6 +105,7 @@ check_functions(functions_list) set(types_list "long long int" + off_t mbstate_t wchar_t _Bool diff --git a/configure.ac b/configure.ac index 0528162117..acedf816ef 100644 --- a/configure.ac +++ b/configure.ac @@ -413,6 +413,7 @@ AC_CHECK_FUNCS([getline]) AC_CHECK_TYPES(wchar_t,,,[#include "wchar.h"]) AC_CHECK_TYPES(long long int) +AC_CHECK_TYPES(off_t,,,[#include "sys/types.h"]) AC_CHECK_TYPES(mbstate_t,,,[#include "wchar.h"]) # ----------------------------------------