Skip to content

Commit 87c21aa

Browse files
committed
Detect presence of 'off_t' by configure test
1 parent d69965c commit 87c21aa

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

ccutil/scanutils.cpp

+5-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@
1919
// See the License for the specific language governing permissions and
2020
// limitations under the License.
2121

22+
#ifdef HAVE_CONFIG_H
23+
#include "config_auto.h"
24+
#endif
25+
2226
#include <ctype.h>
2327
#include <math.h>
2428
#include <stdarg.h>
@@ -34,7 +38,7 @@
3438
#include "tprintf.h"
3539

3640
// workaround for "'off_t' was not declared in this scope" with -std=c++11
37-
#if !defined(off_t) && !defined(__APPLE__) && !defined(__CYGWIN__)
41+
#if !defined(HAVE_OFF_T)
3842
typedef long off_t;
3943
#endif // off_t
4044

cmake/Configure.cmake

+1
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ check_functions(functions_list)
105105

106106
set(types_list
107107
"long long int"
108+
off_t
108109
mbstate_t
109110
wchar_t
110111
_Bool

configure.ac

+1
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,7 @@ AC_CHECK_FUNCS([getline])
413413

414414
AC_CHECK_TYPES(wchar_t,,,[#include "wchar.h"])
415415
AC_CHECK_TYPES(long long int)
416+
AC_CHECK_TYPES(off_t,,,[#include "sys/types.h"])
416417
AC_CHECK_TYPES(mbstate_t,,,[#include "wchar.h"])
417418

418419
# ----------------------------------------

0 commit comments

Comments
 (0)