Skip to content

Commit

Permalink
Detect presence of 'off_t' by configure test
Browse files Browse the repository at this point in the history
  • Loading branch information
doughdemon committed Oct 31, 2015
1 parent d69965c commit 87c21aa
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ccutil/scanutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <ctype.h>
#include <math.h>
#include <stdarg.h>
Expand All @@ -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

Expand Down
1 change: 1 addition & 0 deletions cmake/Configure.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ check_functions(functions_list)

set(types_list
"long long int"
off_t
mbstate_t
wchar_t
_Bool
Expand Down
1 change: 1 addition & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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"])

# ----------------------------------------
Expand Down

0 comments on commit 87c21aa

Please sign in to comment.