Fix int8 configure one more time ... prior version didn't
define INT64_FORMAT in all cases.
This commit is contained in:
parent
98ad3fcfaf
commit
f621b85a2a
1051
src/configure
vendored
1051
src/configure
vendored
File diff suppressed because it is too large
Load Diff
@ -791,8 +791,12 @@ fi
|
|||||||
|
|
||||||
dnl If we found "long int" is 64 bits, assume snprintf handles it.
|
dnl If we found "long int" is 64 bits, assume snprintf handles it.
|
||||||
dnl If we found we need to use "long long int", better check.
|
dnl If we found we need to use "long long int", better check.
|
||||||
|
dnl We cope with snprintfs that use either %lld or %qd as the format.
|
||||||
|
dnl If neither works, fall back to our own snprintf emulation (which we
|
||||||
|
dnl know uses %lld).
|
||||||
|
|
||||||
if [[ x$SNPRINTF = x -a $HAVE_LONG_LONG_INT_64 -eq 1 ]] ; then
|
if [[ $HAVE_LONG_LONG_INT_64 -eq 1 ]] ; then
|
||||||
|
if [[ x$SNPRINTF = x ]] ; then
|
||||||
AC_MSG_CHECKING(whether snprintf handles 'long long int' as %lld)
|
AC_MSG_CHECKING(whether snprintf handles 'long long int' as %lld)
|
||||||
AC_TRY_RUN([#include <stdio.h>
|
AC_TRY_RUN([#include <stdio.h>
|
||||||
typedef long long int int64;
|
typedef long long int int64;
|
||||||
@ -819,7 +823,8 @@ main() {
|
|||||||
exit(! does_int64_snprintf_work());
|
exit(! does_int64_snprintf_work());
|
||||||
}],
|
}],
|
||||||
[ AC_MSG_RESULT(yes)
|
[ AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_INT64_AS_LLD) ],
|
INT64_FORMAT='"%lld"'
|
||||||
|
],
|
||||||
[ AC_MSG_RESULT(no)
|
[ AC_MSG_RESULT(no)
|
||||||
AC_MSG_CHECKING(whether snprintf handles 'long long int' as %qd)
|
AC_MSG_CHECKING(whether snprintf handles 'long long int' as %qd)
|
||||||
AC_TRY_RUN([#include <stdio.h>
|
AC_TRY_RUN([#include <stdio.h>
|
||||||
@ -846,19 +851,35 @@ int does_int64_snprintf_work()
|
|||||||
main() {
|
main() {
|
||||||
exit(! does_int64_snprintf_work());
|
exit(! does_int64_snprintf_work());
|
||||||
}],
|
}],
|
||||||
[ AC_MSG_RESULT(yes)
|
[ AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_INT64_AS_QD) ],
|
INT64_FORMAT='"%qd"'
|
||||||
[ SNPRINTF='snprintf.o'
|
],
|
||||||
AC_MSG_RESULT(no)],
|
[ AC_MSG_RESULT(no)
|
||||||
[ SNPRINTF='snprintf.o'
|
# Force usage of our own snprintf, since system snprintf is broken
|
||||||
AC_MSG_RESULT(assuming not on target machine)]) ],
|
SNPRINTF='snprintf.o'
|
||||||
|
INT64_FORMAT='"%lld"'
|
||||||
[ SNPRINTF='snprintf.o'
|
],
|
||||||
AC_MSG_RESULT(no)],
|
[ AC_MSG_RESULT(assuming not on target machine)
|
||||||
[ SNPRINTF='snprintf.o'
|
# Force usage of our own snprintf, since we cannot test foreign snprintf
|
||||||
AC_MSG_RESULT(assuming not on target machine)])
|
SNPRINTF='snprintf.o'
|
||||||
|
INT64_FORMAT='"%lld"'
|
||||||
|
]) ],
|
||||||
|
[ AC_MSG_RESULT(assuming not on target machine)
|
||||||
|
# Force usage of our own snprintf, since we cannot test foreign snprintf
|
||||||
|
SNPRINTF='snprintf.o'
|
||||||
|
INT64_FORMAT='"%lld"'
|
||||||
|
])
|
||||||
|
else
|
||||||
|
# here if we previously decided we needed to use our own snprintf
|
||||||
|
INT64_FORMAT='"%lld"'
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
# Here if we are not using 'long long int' at all
|
||||||
|
INT64_FORMAT='"%ld"'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
AC_DEFINE_UNQUOTED(INT64_FORMAT, $INT64_FORMAT)
|
||||||
|
|
||||||
|
|
||||||
dnl Check to see if platform has POSIX signal interface.
|
dnl Check to see if platform has POSIX signal interface.
|
||||||
dnl NOTE: if this test fails then POSIX signals definitely don't work.
|
dnl NOTE: if this test fails then POSIX signals definitely don't work.
|
||||||
|
@ -281,18 +281,15 @@ extern void srandom(unsigned int seed);
|
|||||||
/* Set to 1 if your DBL_MIN is problematic */
|
/* Set to 1 if your DBL_MIN is problematic */
|
||||||
#undef HAVE_DBL_MIN_PROBLEM
|
#undef HAVE_DBL_MIN_PROBLEM
|
||||||
|
|
||||||
/* Set to 1 if your snprintf has %lld for 'long long int' */
|
|
||||||
#undef HAVE_INT64_AS_LLD
|
|
||||||
|
|
||||||
/* Set to 1 if your snprintf has %qd for 'long long int' */
|
|
||||||
#undef HAVE_INT64_AS_QD
|
|
||||||
|
|
||||||
/* Set to 1 if type "long int" works and is 64 bits */
|
/* Set to 1 if type "long int" works and is 64 bits */
|
||||||
#undef HAVE_LONG_INT_64
|
#undef HAVE_LONG_INT_64
|
||||||
|
|
||||||
/* Set to 1 if type "long long int" works and is 64 bits */
|
/* Set to 1 if type "long long int" works and is 64 bits */
|
||||||
#undef HAVE_LONG_LONG_INT_64
|
#undef HAVE_LONG_LONG_INT_64
|
||||||
|
|
||||||
|
/* Define this as the appropriate snprintf format for 64-bit ints, if any */
|
||||||
|
#undef INT64_FORMAT
|
||||||
|
|
||||||
/* Define as the base type of the last arg to accept */
|
/* Define as the base type of the last arg to accept */
|
||||||
#undef SOCKET_SIZE_TYPE
|
#undef SOCKET_SIZE_TYPE
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
*
|
*
|
||||||
* Copyright (c) 1994, Regents of the University of California
|
* Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* $Id: int8.h,v 1.11 1999/03/08 04:17:33 scrappy Exp $
|
* $Id: int8.h,v 1.12 1999/03/15 01:43:05 tgl Exp $
|
||||||
*
|
*
|
||||||
* NOTES
|
* NOTES
|
||||||
* These data types are supported on all 64-bit architectures, and may
|
* These data types are supported on all 64-bit architectures, and may
|
||||||
@ -27,26 +27,25 @@
|
|||||||
/* Plain "long int" fits, use it */
|
/* Plain "long int" fits, use it */
|
||||||
typedef long int int64;
|
typedef long int int64;
|
||||||
|
|
||||||
#define INT64_FORMAT "%ld"
|
|
||||||
#else
|
#else
|
||||||
#ifdef HAVE_LONG_LONG_INT_64
|
#ifdef HAVE_LONG_LONG_INT_64
|
||||||
/* We have working support for "long long int", use that */
|
/* We have working support for "long long int", use that */
|
||||||
typedef long long int int64;
|
typedef long long int int64;
|
||||||
|
|
||||||
#ifdef HAVE_INT64_AS_LLD
|
|
||||||
# define INT64_FORMAT "%lld"
|
|
||||||
#elif HAVE_INT64_AS_QD
|
|
||||||
# define INT64_FORMAT "%qd"
|
|
||||||
#endif
|
|
||||||
#else
|
#else
|
||||||
/* Won't actually work, but fall back to long int so that int8.c compiles */
|
/* Won't actually work, but fall back to long int so that int8.c compiles */
|
||||||
typedef long int int64;
|
typedef long int int64;
|
||||||
|
|
||||||
#define INT64_FORMAT "%ld"
|
|
||||||
#define INT64_IS_BUSTED
|
#define INT64_IS_BUSTED
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* this should be set in config.h: */
|
||||||
|
#ifndef INT64_FORMAT
|
||||||
|
#define INT64_FORMAT "%ld"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
extern int64 *int8in(char *str);
|
extern int64 *int8in(char *str);
|
||||||
extern char *int8out(int64 * val);
|
extern char *int8out(int64 * val);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user