diff --git a/ccutil/scanutils.cpp b/ccutil/scanutils.cpp index f49c6f63c..fca4f8192 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 37ea6a100..fae2c9a5b 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 052816211..acedf816e 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"]) # ---------------------------------------- diff --git a/viewer/svutil.cpp b/viewer/svutil.cpp index f94c1c86d..62677f2a1 100644 --- a/viewer/svutil.cpp +++ b/viewer/svutil.cpp @@ -38,6 +38,7 @@ struct addrinfo { #include #include #include +#include #include #ifdef __linux__ #include