Detect presence of 'off_t' by configure test

This commit is contained in:
Felix Janda 2015-10-31 11:54:37 +01:00
parent d69965cb5b
commit 87c21aaa5c
3 changed files with 7 additions and 1 deletions

View File

@ -19,6 +19,10 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
#ifdef HAVE_CONFIG_H
#include "config_auto.h"
#endif
#include <ctype.h> #include <ctype.h>
#include <math.h> #include <math.h>
#include <stdarg.h> #include <stdarg.h>
@ -34,7 +38,7 @@
#include "tprintf.h" #include "tprintf.h"
// workaround for "'off_t' was not declared in this scope" with -std=c++11 // 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; typedef long off_t;
#endif // off_t #endif // off_t

View File

@ -105,6 +105,7 @@ check_functions(functions_list)
set(types_list set(types_list
"long long int" "long long int"
off_t
mbstate_t mbstate_t
wchar_t wchar_t
_Bool _Bool

View File

@ -413,6 +413,7 @@ AC_CHECK_FUNCS([getline])
AC_CHECK_TYPES(wchar_t,,,[#include "wchar.h"]) AC_CHECK_TYPES(wchar_t,,,[#include "wchar.h"])
AC_CHECK_TYPES(long long int) AC_CHECK_TYPES(long long int)
AC_CHECK_TYPES(off_t,,,[#include "sys/types.h"])
AC_CHECK_TYPES(mbstate_t,,,[#include "wchar.h"]) AC_CHECK_TYPES(mbstate_t,,,[#include "wchar.h"])
# ---------------------------------------- # ----------------------------------------