curlbuild.h.dist: enhance non-configure GCC ABI detection logic
authorYang Tse <yangsita@gmail.com>
Fri, 8 Mar 2013 17:43:03 +0000 (18:43 +0100)
committerYang Tse <yangsita@gmail.com>
Fri, 8 Mar 2013 17:43:03 +0000 (18:43 +0100)
GCC specific adjustments:

- check __ILP32__ before 32 and 64bit processor architectures in
  order to detect ILP32 programming model on 64 bit processors
  which, of course, also support LP64 programming model, when using
  gcc 4.7 or newer.

- keep 32bit processor architecture checks in order to support gcc
  versions older than 4.7 which don't define __ILP32__

- check __LP64__ for gcc 3.3 and newer, while keeping 64bit processor
  architecture checks for older versions which don't define __LP64__

include/curl/curlbuild.h.dist

index 5737cc0..3ad2f01 100644 (file)
@@ -7,7 +7,7 @@
  *                            | (__| |_| |  _ <| |___
  *                             \___|\___/|_| \_\_____|
  *
- * Copyright (C) 1998 - 2010, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2013, Daniel Stenberg, <daniel@haxx.se>, et al.
  *
  * This software is licensed as described in the file COPYING, which
  * you should have received as part of this distribution. The terms
 /* ===================================== */
 
 #elif defined(__GNUC__)
-#  if defined(__i386__) || defined(__ppc__) || defined(__arm__)
+#  if defined(__ILP32__) || \
+      defined(__i386__) || defined(__ppc__) || defined(__arm__)
 #    define CURL_SIZEOF_LONG           4
 #    define CURL_TYPEOF_CURL_OFF_T     long long
 #    define CURL_FORMAT_CURL_OFF_T     "lld"
 #    define CURL_SIZEOF_CURL_OFF_T     8
 #    define CURL_SUFFIX_CURL_OFF_T     LL
 #    define CURL_SUFFIX_CURL_OFF_TU    ULL
-#  elif defined(__x86_64__) || defined(__ppc64__)
+#  elif defined(__LP64__) || \
+        defined(__x86_64__) || defined(__ppc64__)
 #    define CURL_SIZEOF_LONG           8
 #    define CURL_TYPEOF_CURL_OFF_T     long
 #    define CURL_FORMAT_CURL_OFF_T     "ld"