Get rid of ENABLE_64BIT symbol definition and usage.
authorYang Tse <yangsita@gmail.com>
Thu, 21 Aug 2008 00:06:15 +0000 (00:06 +0000)
committerYang Tse <yangsita@gmail.com>
Thu, 21 Aug 2008 00:06:15 +0000 (00:06 +0000)
Improve HAVE_LONGLONG symbol description.

ares/configure.ac
configure.ac
lib/config-os400.h
lib/config-symbian.h
lib/config-tpf.h
lib/mprintf.c
lib/setup.h
lib/version.c
src/config-win32.h

index a4361c31c664cb57e3ab7f25c26d167c65784824..6a8cf7dceb8a6cd35e536d1bd11436d62c4054f2 100644 (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"  
 )
 
index 9ebb9ba6de3eb6df258d538fb609574ae2ebc272..76ccb88295a123f1c43cbef40457fc1f90691eb6 100644 (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"
 )
 
index c52098731e2a8f123e81dc4906713a62b42efb67..abe9bb8750d89b519db50e81e0363fe60133bfc3 100644 (file)
 /* 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. */
index a39669c48fa4aa574eceed515e3759beb92541f9..6c91cba361b02c8e2fa06b44e23711b955057f3e 100644 (file)
 /* 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. */
index f8d193e1799fc97f7f287525842ff56dff858260..104fb81160ae1003f0ef9c43cd750aa5dad0298b 100644 (file)
 /* 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  */
index 475bdded577702eedfa7a92c3c1a4bc02c366175..f139c8da1fe9fb76535d56738297bfe52f7a60bc 100644 (file)
 #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
 
index 9cf3d8f31b0ded5a544d3e9e45b65f93d8d17f9b..4354f7fa8e13e5a8f970eebef5431395ffacb823 100644 (file)
 #  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
index a2828ceaef476e4ed21b292c80fb4add0940dc32..5b9ccca3dfa7e131450e379014981700a717546b 100644 (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)
index 306f42ee256c54b66ba92952324bdd33f27fc113..84a16fdc8777a242f2f5f3c7f8da6bfcb6453474 100644 (file)
 #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