1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-21 23:58:49 -05:00

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_SIZEOF(time_t)
AC_CHECK_TYPE(long long, 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" longlong="yes"
) )

View File

@ -2001,7 +2001,8 @@ AC_CHECK_SIZEOF(time_t)
AC_CHECK_SIZEOF(off_t) AC_CHECK_SIZEOF(off_t)
AC_CHECK_TYPE(long long, 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" longlong="yes"
) )

View File

@ -364,7 +364,7 @@
/* The size of a `long double', as computed by sizeof. */ /* The size of a `long double', as computed by sizeof. */
#define SIZEOF_LONG_DOUBLE 8 #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 #define HAVE_LONGLONG
/* The size of a `long long', as computed by sizeof. */ /* 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 to 1 if you have the `localtime_r' function. */
#define HAVE_LOCALTIME_R 1 #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 HAVE_LONGLONG 1
/* Define to 1 if you have the malloc.h header file. */ /* 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 to 1 if you have the `localtime_r' function. */
#define HAVE_LOCALTIME_R 1 #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 HAVE_LONGLONG 1
/* Define to 1 if you need the malloc.h header file even with stdlib.h */ /* 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 #define SIZEOF_SIZE_T 4
#endif #endif
#ifdef DPRINTF_DEBUG #ifdef HAVE_LONGLONG
#define HAVE_LONGLONG # define LONG_LONG_TYPE long long
#define LONG_LONG long long # define HAVE_LONG_LONG_TYPE
#define ENABLE_64BIT #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 #endif
#include "memory.h" #include "memory.h"
@ -150,8 +157,8 @@ typedef struct {
char *str; char *str;
void *ptr; void *ptr;
long num; long num;
#ifdef ENABLE_64BIT #ifdef HAVE_LONG_LONG_TYPE
LONG_LONG lnum; LONG_LONG_TYPE lnum;
#endif #endif
double dnum; double dnum;
} data; } data;
@ -560,9 +567,9 @@ static long dprintf_Pass1(const char *format, va_stack_t *vto, char **endpos,
break; break;
case FORMAT_INT: case FORMAT_INT:
#ifdef ENABLE_64BIT #ifdef HAVE_LONG_LONG_TYPE
if(vto[i].flags & FLAGS_LONGLONG) 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 else
#endif #endif
{ {
@ -645,8 +652,8 @@ static int dprintf_formatf(
long base; long base;
/* Integral values to be written. */ /* Integral values to be written. */
#ifdef ENABLE_64BIT #ifdef HAVE_LONG_LONG_TYPE
unsigned LONG_LONG num; unsigned LONG_LONG_TYPE num;
#else #else
unsigned long num; unsigned long num;
#endif #endif
@ -708,7 +715,7 @@ static int dprintf_formatf(
switch (p->type) { switch (p->type) {
case FORMAT_INT: case FORMAT_INT:
#ifdef ENABLE_64BIT #ifdef HAVE_LONG_LONG_TYPE
if(p->flags & FLAGS_LONGLONG) if(p->flags & FLAGS_LONGLONG)
num = p->data.lnum; num = p->data.lnum;
else else
@ -746,7 +753,7 @@ static int dprintf_formatf(
/* Decimal integer. */ /* Decimal integer. */
base = 10; base = 10;
#ifdef ENABLE_64BIT #ifdef HAVE_LONG_LONG_TYPE
if(p->flags & FLAGS_LONGLONG) { if(p->flags & FLAGS_LONGLONG) {
/* long long */ /* long long */
is_neg = (char)(p->data.lnum < 0); is_neg = (char)(p->data.lnum < 0);
@ -978,9 +985,9 @@ static int dprintf_formatf(
case FORMAT_INTPTR: case FORMAT_INTPTR:
/* Answer the count of characters written. */ /* Answer the count of characters written. */
#ifdef ENABLE_64BIT #ifdef HAVE_LONG_LONG_TYPE
if(p->flags & FLAGS_LONGLONG) if(p->flags & FLAGS_LONGLONG)
*(LONG_LONG *) p->data.ptr = (LONG_LONG)done; *(LONG_LONG_TYPE *) p->data.ptr = (LONG_LONG_TYPE)done;
else else
#endif #endif
if(p->flags & FLAGS_LONG) if(p->flags & FLAGS_LONG)
@ -1199,10 +1206,10 @@ int main()
{ {
char buffer[129]; char buffer[129];
char *ptr; char *ptr;
#ifdef ENABLE_64BIT #ifdef HAVE_LONG_LONG_TYPE
long long one=99; LONG_LONG_TYPE one=99;
long long two=100; LONG_LONG_TYPE two=100;
long long test = 0x1000000000LL; LONG_LONG_TYPE test = 0x1000000000LL;
curl_mprintf("%lld %lld %lld\n", one, two, test); curl_mprintf("%lld %lld %lld\n", one, two, test);
#endif #endif

View File

@ -213,17 +213,6 @@
# endif # endif
#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 #ifdef HAVE_EXTRA_STRICMP_H
# include <extra/stricmp.h> # include <extra/stricmp.h>
#endif #endif

View File

@ -190,7 +190,16 @@ static curl_version_info_data version_info = {
#ifdef HAVE_SPNEGO #ifdef HAVE_SPNEGO
| CURL_VERSION_SPNEGO | CURL_VERSION_SPNEGO
#endif #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 | CURL_VERSION_LARGEFILE
#endif #endif
#if defined(CURL_DOES_CONVERSIONS) #if defined(CURL_DOES_CONVERSIONS)

View File

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