Get rid of ENABLE_64BIT symbol definition and usage.

Improve HAVE_LONGLONG symbol description.
This commit is contained in:
Yang Tse 2008-08-21 00:06:15 +00:00
parent 44142f8234
commit ceb49d3742
9 changed files with 43 additions and 36 deletions

View File

@ -582,7 +582,8 @@ AC_CHECK_SIZEOF(long)
AC_CHECK_SIZEOF(time_t)
AC_CHECK_TYPE(long long,
[AC_DEFINE(HAVE_LONGLONG, 1, [if your compiler supports long long])]
[AC_DEFINE(HAVE_LONGLONG, 1,
[Define to 1 if the compiler supports the 'long long' data type.])]
longlong="yes"
)

View File

@ -2001,7 +2001,8 @@ AC_CHECK_SIZEOF(time_t)
AC_CHECK_SIZEOF(off_t)
AC_CHECK_TYPE(long long,
[AC_DEFINE(HAVE_LONGLONG, 1, [if your compiler supports long long])]
[AC_DEFINE(HAVE_LONGLONG, 1,
[Define to 1 if the compiler supports the 'long long' data type.])]
longlong="yes"
)

View File

@ -364,7 +364,7 @@
/* The size of a `long double', as computed by sizeof. */
#define SIZEOF_LONG_DOUBLE 8
/* Define if 64 bit integers are supported. */
/* Define if the compiler supports the 'long long' data type. */
#define HAVE_LONGLONG
/* The size of a `long long', as computed by sizeof. */

View File

@ -312,7 +312,7 @@
/* Define to 1 if you have the `localtime_r' function. */
#define HAVE_LOCALTIME_R 1
/* if your compiler supports long long */
/* Define to 1 if the compiler supports the 'long long' data type. */
#define HAVE_LONGLONG 1
/* Define to 1 if you have the malloc.h header file. */

View File

@ -272,7 +272,7 @@
/* Define to 1 if you have the `localtime_r' function. */
#define HAVE_LOCALTIME_R 1
/* if your compiler supports long long */
/* Define to 1 if the compiler supports the 'long long' data type. */
#define HAVE_LONGLONG 1
/* Define to 1 if you need the malloc.h header file even with stdlib.h */

View File

@ -58,10 +58,17 @@
#define SIZEOF_SIZE_T 4
#endif
#ifdef DPRINTF_DEBUG
#define HAVE_LONGLONG
#define LONG_LONG long long
#define ENABLE_64BIT
#ifdef HAVE_LONGLONG
# define LONG_LONG_TYPE long long
# define HAVE_LONG_LONG_TYPE
#else
# if defined(_MSC_VER) && (_MSC_VER >= 900)
# define LONG_LONG_TYPE __int64
# define HAVE_LONG_LONG_TYPE
# else
# undef LONG_LONG_TYPE
# undef HAVE_LONG_LONG_TYPE
# endif
#endif
#include "memory.h"
@ -150,8 +157,8 @@ typedef struct {
char *str;
void *ptr;
long num;
#ifdef ENABLE_64BIT
LONG_LONG lnum;
#ifdef HAVE_LONG_LONG_TYPE
LONG_LONG_TYPE lnum;
#endif
double dnum;
} data;
@ -560,9 +567,9 @@ static long dprintf_Pass1(const char *format, va_stack_t *vto, char **endpos,
break;
case FORMAT_INT:
#ifdef ENABLE_64BIT
#ifdef HAVE_LONG_LONG_TYPE
if(vto[i].flags & FLAGS_LONGLONG)
vto[i].data.lnum = va_arg(arglist, LONG_LONG);
vto[i].data.lnum = va_arg(arglist, LONG_LONG_TYPE);
else
#endif
{
@ -645,8 +652,8 @@ static int dprintf_formatf(
long base;
/* Integral values to be written. */
#ifdef ENABLE_64BIT
unsigned LONG_LONG num;
#ifdef HAVE_LONG_LONG_TYPE
unsigned LONG_LONG_TYPE num;
#else
unsigned long num;
#endif
@ -708,7 +715,7 @@ static int dprintf_formatf(
switch (p->type) {
case FORMAT_INT:
#ifdef ENABLE_64BIT
#ifdef HAVE_LONG_LONG_TYPE
if(p->flags & FLAGS_LONGLONG)
num = p->data.lnum;
else
@ -746,7 +753,7 @@ static int dprintf_formatf(
/* Decimal integer. */
base = 10;
#ifdef ENABLE_64BIT
#ifdef HAVE_LONG_LONG_TYPE
if(p->flags & FLAGS_LONGLONG) {
/* long long */
is_neg = (char)(p->data.lnum < 0);
@ -978,9 +985,9 @@ static int dprintf_formatf(
case FORMAT_INTPTR:
/* Answer the count of characters written. */
#ifdef ENABLE_64BIT
#ifdef HAVE_LONG_LONG_TYPE
if(p->flags & FLAGS_LONGLONG)
*(LONG_LONG *) p->data.ptr = (LONG_LONG)done;
*(LONG_LONG_TYPE *) p->data.ptr = (LONG_LONG_TYPE)done;
else
#endif
if(p->flags & FLAGS_LONG)
@ -1199,10 +1206,10 @@ int main()
{
char buffer[129];
char *ptr;
#ifdef ENABLE_64BIT
long long one=99;
long long two=100;
long long test = 0x1000000000LL;
#ifdef HAVE_LONG_LONG_TYPE
LONG_LONG_TYPE one=99;
LONG_LONG_TYPE two=100;
LONG_LONG_TYPE test = 0x1000000000LL;
curl_mprintf("%lld %lld %lld\n", one, two, test);
#endif

View File

@ -213,17 +213,6 @@
# endif
#endif
#ifdef HAVE_LONGLONG
#define LONG_LONG long long
#define ENABLE_64BIT
#else
#ifdef _MSC_VER
#define LONG_LONG __int64
#define ENABLE_64BIT
#endif /* _MSC_VER */
#endif /* HAVE_LONGLONG */
#ifdef HAVE_EXTRA_STRICMP_H
# include <extra/stricmp.h>
#endif

View File

@ -190,7 +190,16 @@ static curl_version_info_data version_info = {
#ifdef HAVE_SPNEGO
| CURL_VERSION_SPNEGO
#endif
#if defined(ENABLE_64BIT) && (CURL_SIZEOF_CURL_OFF_T > 4)
/*
* FIXME before 7.19.0 release.
*
* libcurl is largefile enabled when (CURL_SIZEOF_CURL_OFF_T > 4) _AND_
* libcurl has been built with sizeof(system off_t) > 4 or when large
* file support is available even with sizeof(system off_t) <= 4.
*
* Until this is adjusted, only the (CURL_SIZEOF_CURL_OFF_T > 4) check is done.
*/
#if (CURL_SIZEOF_CURL_OFF_T > 4)
| CURL_VERSION_LARGEFILE
#endif
#if defined(CURL_DOES_CONVERSIONS)

View File

@ -200,7 +200,7 @@
#define HAVE_VARIADIC_MACROS_C99 1
#endif
/* Define if the compiler supports LONGLONG. */
/* Define if the compiler supports the 'long long' data type. */
#if defined(__MINGW32__) || defined(__WATCOMC__)
#define HAVE_LONGLONG 1
#endif