diff options
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index 3e91ae19..83587b82 100644 --- a/configure.ac +++ b/configure.ac @@ -505,6 +505,39 @@ if test "$BUILDRULES" != "msvc"; then fi fi +LL_FMT="" +oCFLAGS=$CFLAGS +CFLAGS="$WFLAGS $CFLAGS" +for fmt in "%lld" "%I64d" "%I64lld"; do + if test "$LL_FMT" = ""; then + AC_MSG_CHECKING(printf format for long long: $fmt) + AC_RUN_IFELSE([AC_LANG_PROGRAM( + [[ + #define _CRT_SECURE_NO_WARNINGS + #include <stdio.h> + #include <string.h> + ]], + [[ + long long int a = 123456789012345ll; + char s[30]; + sprintf(s, "]$fmt[", a); + return (strcmp(s, "123456789012345") == 0) ? 0 : 1 + ]] + )], + [LL_FMT=$fmt],[],[LL_FMT="%lld"]) + if test "$LL_FMT" != ""; then + AC_MSG_RESULT(yes) + else + AC_MSG_RESULT(no) + fi + fi +done +CFLAGS=$oCFLAGS +if test "LL_FMT" = ""; then + LL_FMT="%lld%" +fi +AC_DEFINE_UNQUOTED([LL_FMT], ["$LL_FMT"], [printf format for long long]) + AC_SUBST(WINDOWS_WMAIN_XLINK_FLAGS) AC_SUBST(WINDOWS_MAIN_XLINK_FLAGS) if test "$BUILDRULES" = "msvc"; then |