tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rj...@apache.org
Subject svn commit: r406380 - in /tomcat/connectors/trunk/jk/native: common/jk_global.h common/jk_global.h.in common/jk_lb_worker.c common/jk_md5.c common/jk_md5.h common/jk_shm.h common/jk_status.c common/portable.h.sample configure.in
Date Sun, 14 May 2006 17:16:52 GMT
Author: rjung
Date: Sun May 14 10:16:50 2006
New Revision: 406380

URL: http://svn.apache.org/viewcvs?rev=406380&view=rev
Log:
Use autoconf in a consistent way to detect
32-bit and 64-bit integer types.
Borrowed from APR.
Detect types and printf formats in configure,
and add information to common/jk_global.h.
Use this in common/jk_md5.[ch], common/jk_status.c
common/jk_shm.h and common/jk_lb_worker.c.

Added:
    tomcat/connectors/trunk/jk/native/common/jk_global.h.in
      - copied, changed from r406377, tomcat/connectors/trunk/jk/native/common/jk_global.h
Removed:
    tomcat/connectors/trunk/jk/native/common/jk_global.h
Modified:
    tomcat/connectors/trunk/jk/native/common/jk_lb_worker.c
    tomcat/connectors/trunk/jk/native/common/jk_md5.c
    tomcat/connectors/trunk/jk/native/common/jk_md5.h
    tomcat/connectors/trunk/jk/native/common/jk_shm.h
    tomcat/connectors/trunk/jk/native/common/jk_status.c
    tomcat/connectors/trunk/jk/native/common/portable.h.sample
    tomcat/connectors/trunk/jk/native/configure.in

Copied: tomcat/connectors/trunk/jk/native/common/jk_global.h.in (from r406377, tomcat/connectors/trunk/jk/native/common/jk_global.h)
URL: http://svn.apache.org/viewcvs/tomcat/connectors/trunk/jk/native/common/jk_global.h.in?p2=tomcat/connectors/trunk/jk/native/common/jk_global.h.in&p1=tomcat/connectors/trunk/jk/native/common/jk_global.h&r1=406377&r2=406380&rev=406380&view=diff
==============================================================================
--- tomcat/connectors/trunk/jk/native/common/jk_global.h (original)
+++ tomcat/connectors/trunk/jk/native/common/jk_global.h.in Sun May 14 10:16:50 2006
@@ -24,6 +24,12 @@
 #ifndef JK_GLOBAL_H
 #define JK_GLOBAL_H
 
+/* GENERATED FILE WARNING!  DO NOT EDIT jk_global.h
+ *
+ * You must modify jk_global.h.in instead.
+ *
+ */
+
 #ifndef NETWARE
 #if !defined(WIN32) && !defined(AS400)
 #include "portable.h"
@@ -242,6 +248,57 @@
 
 #endif                          /* APR_CHARSET_EBCDIC */
 
+/* jk_uint32_t defines a four byte word */
+#if defined (WIN32)
+    typedef UINT32 jk_uint32_t;
+#define JK_INT32_T_FMT "I32d"
+#define JK_UINT32_T_FMT "I32u"
+#define JK_UINT32_T_HEX_FMT "I32x"
+#elif defined(NETWARE) && !defined(__NOVELL_LIBC__)
+    typedef unsigned int jk_uint32_t;
+#else
+    typedef unsigned @int32_value@ jk_uint32_t;
+
+/* And JK_INT32_T_FMT */
+@int32_t_fmt@
+
+/* And JK_UINT32_T_FMT */
+@uint32_t_fmt@
+
+/* And JK_UINT32_T_HEX_FMT */
+@uint32_t_hex_fmt@
+#endif
+#define JK_INT32_T_FMT_LEN  (sizeof(JK_INT32_T_FMT) - 1)
+#define JK_UINT32_T_FMT_LEN  (sizeof(JK_UINT32_T_FMT) - 1)
+#define JK_UINT32_T_HEX_FMT_LEN  (sizeof(JK_UINT32_T_HEX_FMT) - 1)
+
+/* jk_uint64_t defines a four byte word */
+#if defined (WIN32)
+    typedef UINT64 jk_uint64_t;
+#define JK_INT64_T_FMT "I64d"
+#define JK_UINT64_T_FMT "I64u"
+#define JK_UINT64_T_HEX_FMT "I64x"
+#elif defined(AS400)
+    typedef unsigned long long jk_uint64_t;
+#define JK_INT64_T_FMT "lld"
+#define JK_UINT64_T_FMT "llu"
+#define JK_UINT64_T_HEX_FMT "llx"
+#else
+    typedef unsigned @int64_value@ jk_uint64_t;
+
+/* And JK_INT64_T_FMT */
+@int64_t_fmt@
+
+/* And JK_UINT64_T_FMT */
+@uint64_t_fmt@
+
+/* And JK_UINT64_T_HEX_FMT */
+@uint64_t_hex_fmt@
+#endif
+#define JK_INT64_T_FMT_LEN  (sizeof(JK_INT64_T_FMT) - 1)
+#define JK_UINT64_T_FMT_LEN  (sizeof(JK_UINT64_T_FMT) - 1)
+#define JK_UINT64_T_HEX_FMT_LEN  (sizeof(JK_UINT64_T_HEX_FMT) - 1)
+
 #ifdef WIN32
 /* For WIN32, emulate gettimeofday() using _ftime() */
 #define gettimeofday(tv,tz) { struct _timeb tb; _ftime(&tb); (tv)->tv_sec = tb.time;
(tv)->tv_usec = tb.millitm * 1000; }
@@ -253,15 +310,6 @@
 #define snprintf _snprintf
 #define vsnprintf _vsnprintf
 #endif
-typedef unsigned __int64 jk_u64_t;
-#elif defined(HAVE_LONG_LONG64) || defined(AS400)
-typedef unsigned long long jk_u64_t;
-#elif defined(HAVE_LONGLONG64)
-typedef unsigned longlong jk_u64_t;
-#elif defined(HAVE_LONG64)
-typedef unsigned long jk_u64_t;
-#else
-typedef unsigned int jk_u64_t; /* HAVE_INT64 ! */
 #endif
 
 /* Use apr snprintf() and vsnprintf() when needed */

Modified: tomcat/connectors/trunk/jk/native/common/jk_lb_worker.c
URL: http://svn.apache.org/viewcvs/tomcat/connectors/trunk/jk/native/common/jk_lb_worker.c?rev=406380&r1=406379&r2=406380&view=diff
==============================================================================
--- tomcat/connectors/trunk/jk/native/common/jk_lb_worker.c (original)
+++ tomcat/connectors/trunk/jk/native/common/jk_lb_worker.c Sun May 14 10:16:50 2006
@@ -221,8 +221,8 @@
 {
     unsigned int i;
     int total_factor = 0;
-    jk_u64_t mytraffic = 0;
-    jk_u64_t curmin = 0;
+    jk_uint64_t mytraffic = 0;
+    jk_uint64_t curmin = 0;
     int bfn = 1;
     int bfd = 1;
 
@@ -329,8 +329,8 @@
                                              jk_logger_t *l)
 {
     unsigned int i;
-    jk_u64_t mytraffic = 0;
-    jk_u64_t curmin = 0;
+    jk_uint64_t mytraffic = 0;
+    jk_uint64_t curmin = 0;
     worker_record_t *candidate = NULL;
     double diff;
     time_t now = time(NULL);

Modified: tomcat/connectors/trunk/jk/native/common/jk_md5.c
URL: http://svn.apache.org/viewcvs/tomcat/connectors/trunk/jk/native/common/jk_md5.c?rev=406380&r1=406379&r2=406380&view=diff
==============================================================================
--- tomcat/connectors/trunk/jk/native/common/jk_md5.c (original)
+++ tomcat/connectors/trunk/jk/native/common/jk_md5.c Sun May 14 10:16:50 2006
@@ -118,9 +118,9 @@
 #define S43 15
 #define S44 21
 
-static void MD5Transform(JK_UINT4 state[4], const unsigned char block[64]);
-static void Encode(unsigned char *output, const JK_UINT4 * input, size_t len);
-static void Decode(JK_UINT4 * output, const unsigned char *input, size_t len);
+static void MD5Transform(jk_uint32_t state[4], const unsigned char block[64]);
+static void Encode(unsigned char *output, const jk_uint32_t * input, size_t len);
+static void Decode(jk_uint32_t * output, const unsigned char *input, size_t len);
 static void jk_MD5Init(JK_MD5_CTX * context);
 static void jk_MD5Update(JK_MD5_CTX * context, const unsigned char *input,
                          size_t inputLen);
@@ -147,22 +147,22 @@
    Rotation is separate from addition to prevent recomputation.
  */
 #define FF(a, b, c, d, x, s, ac) { \
- (a) += F ((b), (c), (d)) + (x) + (JK_UINT4)(ac); \
+ (a) += F ((b), (c), (d)) + (x) + (jk_uint32_t)(ac); \
  (a) = ROTATE_LEFT ((a), (s)); \
  (a) += (b); \
   }
 #define GG(a, b, c, d, x, s, ac) { \
- (a) += G ((b), (c), (d)) + (x) + (JK_UINT4)(ac); \
+ (a) += G ((b), (c), (d)) + (x) + (jk_uint32_t)(ac); \
  (a) = ROTATE_LEFT ((a), (s)); \
  (a) += (b); \
   }
 #define HH(a, b, c, d, x, s, ac) { \
- (a) += H ((b), (c), (d)) + (x) + (JK_UINT4)(ac); \
+ (a) += H ((b), (c), (d)) + (x) + (jk_uint32_t)(ac); \
  (a) = ROTATE_LEFT ((a), (s)); \
  (a) += (b); \
   }
 #define II(a, b, c, d, x, s, ac) { \
- (a) += I ((b), (c), (d)) + (x) + (JK_UINT4)(ac); \
+ (a) += I ((b), (c), (d)) + (x) + (jk_uint32_t)(ac); \
  (a) = ROTATE_LEFT ((a), (s)); \
  (a) += (b); \
   }
@@ -192,11 +192,11 @@
     idx = (size_t) ((context->count[0] >> 3) & 0x3F);
 
     /* Update number of bits */
-    if ((context->count[0] += ((JK_UINT4) inputLen << 3))
-        < ((JK_UINT4) inputLen << 3)) {
+    if ((context->count[0] += ((jk_uint32_t) inputLen << 3))
+        < ((jk_uint32_t) inputLen << 3)) {
         context->count[1]++;
     }
-    context->count[1] += (JK_UINT4) inputLen >> 29;
+    context->count[1] += (jk_uint32_t) inputLen >> 29;
 
     partLen = 64 - idx;
 
@@ -283,9 +283,9 @@
 }
 
 /* MD5 basic transformation. Transforms state based on block. */
-static void MD5Transform(JK_UINT4 state[4], const unsigned char block[64])
+static void MD5Transform(jk_uint32_t state[4], const unsigned char block[64])
 {
-    JK_UINT4 a = state[0], b = state[1], c = state[2], d = state[3], x[16];
+    jk_uint32_t a = state[0], b = state[1], c = state[2], d = state[3], x[16];
 
     Decode(x, block, 64);
 
@@ -370,13 +370,13 @@
     memset(x, 0, sizeof(x));
 }
 
-/* Encodes input (JK_UINT4) into output (unsigned char). Assumes len is
+/* Encodes input (jk_uint32_t) into output (unsigned char). Assumes len is
    a multiple of 4.
  */
-static void Encode(unsigned char *output, const JK_UINT4 * input, size_t len)
+static void Encode(unsigned char *output, const jk_uint32_t * input, size_t len)
 {
     size_t i, j;
-    JK_UINT4 k;
+    jk_uint32_t k;
 
     for (i = 0, j = 0; j < len; i++, j += 4) {
         k = input[i];
@@ -387,16 +387,16 @@
     }
 }
 
-/* Decodes input (unsigned char) into output (JK_UINT4). Assumes len is
+/* Decodes input (unsigned char) into output (jk_uint32_t). Assumes len is
  * a multiple of 4.
  */
-static void Decode(JK_UINT4 * output, const unsigned char *input, size_t len)
+static void Decode(jk_uint32_t * output, const unsigned char *input, size_t len)
 {
     size_t i, j;
 
     for (i = 0, j = 0; j < len; i++, j += 4)
-        output[i] = ((JK_UINT4) input[j]) | (((JK_UINT4) input[j + 1]) << 8) |
-            (((JK_UINT4) input[j + 2]) << 16) | (((JK_UINT4) input[j + 3]) <<
+        output[i] = ((jk_uint32_t) input[j]) | (((jk_uint32_t) input[j + 1]) << 8)
|
+            (((jk_uint32_t) input[j + 2]) << 16) | (((jk_uint32_t) input[j + 3]) <<
                                                  24);
 }
 

Modified: tomcat/connectors/trunk/jk/native/common/jk_md5.h
URL: http://svn.apache.org/viewcvs/tomcat/connectors/trunk/jk/native/common/jk_md5.h?rev=406380&r1=406379&r2=406380&view=diff
==============================================================================
--- tomcat/connectors/trunk/jk/native/common/jk_md5.h (original)
+++ tomcat/connectors/trunk/jk/native/common/jk_md5.h Sun May 14 10:16:50 2006
@@ -56,24 +56,11 @@
 
 #define JK_MD5_DIGESTSIZE 16
 
-/* JK_UINT4 defines a four byte word */
-#if defined (WIN32)
-    typedef DWORD JK_UINT4;
-#elif defined(NETWARE) && !defined(__NOVELL_LIBC__)
-    typedef unsigned int JK_UINT4;
-#elif defined(HAVE_UINT32_T)
-    typedef uint32_t JK_UINT4;
-#elif defined(HAVE_U_INT32_T)
-    typedef u_int32_t JK_UINT4;
-#else
-    typedef unsigned long JK_UINT4; /* ansi HAVE_LONG */
-#endif
-
 /* MD5 context. */
 typedef struct
 {
-    JK_UINT4 state[4];      /* state (ABCD) */
-    JK_UINT4 count[2];      /* number of bits, modulo 2^64 (lsb first) */
+    jk_uint32_t state[4];      /* state (ABCD) */
+    jk_uint32_t count[2];      /* number of bits, modulo 2^64 (lsb first) */
     unsigned char buffer[64];       /* input buffer */
 } JK_MD5_CTX;
 

Modified: tomcat/connectors/trunk/jk/native/common/jk_shm.h
URL: http://svn.apache.org/viewcvs/tomcat/connectors/trunk/jk/native/common/jk_shm.h?rev=406380&r1=406379&r2=406380&view=diff
==============================================================================
--- tomcat/connectors/trunk/jk/native/common/jk_shm.h (original)
+++ tomcat/connectors/trunk/jk/native/common/jk_shm.h Sun May 14 10:16:50 2006
@@ -91,9 +91,9 @@
     /* Service transfer rate time */
     volatile time_t  service_time;
     /* Number of bytes read from remote */
-    volatile jk_u64_t readed;
+    volatile jk_uint64_t readed;
     /* Number of bytes transferred to remote */
-    volatile jk_u64_t transferred;
+    volatile jk_uint64_t transferred;
     /* Number of times the worker was elected */
     volatile size_t  elected;
     /* Number of non 200 responses */

Modified: tomcat/connectors/trunk/jk/native/common/jk_status.c
URL: http://svn.apache.org/viewcvs/tomcat/connectors/trunk/jk/native/common/jk_status.c?rev=406380&r1=406379&r2=406380&view=diff
==============================================================================
--- tomcat/connectors/trunk/jk/native/common/jk_status.c (original)
+++ tomcat/connectors/trunk/jk/native/common/jk_status.c Sun May 14 10:16:50 2006
@@ -166,7 +166,7 @@
 }
 
 /* Actually APR's apr_strfsize */
-static char *status_strfsize(jk_u64_t size, char *buf)
+static char *status_strfsize(jk_uint64_t size, char *buf)
 {
     const char ord[] = "KMGTPE";
     const char *o = ord;
@@ -654,10 +654,11 @@
             jk_printf(s, " lbfactor=\"%d\"", wr->s->lb_factor);
             jk_printf(s, " lbvalue=\"%d\"", wr->s->lb_value);
             jk_printf(s, " elected=\"%u\"", wr->s->elected);
-            jk_printf(s, " readed=\"%u\"", wr->s->readed);
-            jk_printf(s, " transferred=\"%u\"", wr->s->transferred);
             jk_printf(s, " errors=\"%u\"", wr->s->errors);
+            jk_printf(s, " transferred=\"%" JK_UINT64_T_FMT "\"", wr->s->transferred);
+            jk_printf(s, " readed=\"%" JK_UINT64_T_FMT "\"", wr->s->readed);
             jk_printf(s, " busy=\"%u\"", wr->s->busy);
+            jk_printf(s, " maxbusy=\"%u\"", wr->s->max_busy);
             if (wr->s->redirect && *wr->s->redirect)
                 jk_printf(s, " redirect=\"%s\"", wr->s->redirect);
             if (wr->s->domain && *wr->s->domain)

Modified: tomcat/connectors/trunk/jk/native/common/portable.h.sample
URL: http://svn.apache.org/viewcvs/tomcat/connectors/trunk/jk/native/common/portable.h.sample?rev=406380&r1=406379&r2=406380&view=diff
==============================================================================
--- tomcat/connectors/trunk/jk/native/common/portable.h.sample (original)
+++ tomcat/connectors/trunk/jk/native/common/portable.h.sample Sun May 14 10:16:50 2006
@@ -8,24 +8,9 @@
 /* Have flock() */
 #define HAVE_FLOCK 1
 
-/* Use int for JK_UINT8 */
-/* #undef HAVE_INT64 */
-
 /* Define to 1 if you have the <inttypes.h> header file. */
 #define HAVE_INTTYPES_H 1
 
-/* Use unsigned long for JK_UINT4 */
-/* #undef HAVE_LONG */
-
-/* Use long for JK_UINT8 */
-/* #undef HAVE_LONG64 */
-
-/* Use longlong for JK_UINT8 */
-/* #undef HAVE_LONGLONG64 */
-
-/* Use long long for JK_UINT8 */
-#define HAVE_LONG_LONG64 
-
 /* Define to 1 if you have the <memory.h> header file. */
 #define HAVE_MEMORY_H 1
 
@@ -50,15 +35,9 @@
 /* Define to 1 if you have the <sys/types.h> header file. */
 #define HAVE_SYS_TYPES_H 1
 
-/* Use uint32_t for JK_UINT4 */
-#define HAVE_UINT32_T 
-
 /* Define to 1 if you have the <unistd.h> header file. */
 #define HAVE_UNISTD_H 1
 
-/* Use u_int32_t for JK_UINT4 */
-/* #undef HAVE_U_INT32_T */
-
 /* Have vsnprintf() */
 #define HAVE_VSNPRINTF 1
 
@@ -80,23 +59,26 @@
 /* Define to the version of this package. */
 #define PACKAGE_VERSION ""
 
-/* The size of a `uint32_t', as computed by sizeof. */
-#define SIZEOF_UINT32_T 4
+/* The size of a `char', as computed by sizeof. */
+#define SIZEOF_CHAR 1
+
+/* The size of a `int', as computed by sizeof. */
+#define SIZEOF_INT 4
 
-/* The size of a `unsigned int', as computed by sizeof. */
-#define SIZEOF_UNSIGNED_INT 4
+/* The size of a `long', as computed by sizeof. */
+#define SIZEOF_LONG 4
 
-/* The size of a `unsigned long', as computed by sizeof. */
-#define SIZEOF_UNSIGNED_LONG 4
+/* The size of a `longlong', as computed by sizeof. */
+#define SIZEOF_LONGLONG 0
 
-/* The size of a `unsigned longlong', as computed by sizeof. */
-#define SIZEOF_UNSIGNED_LONGLONG 0
+/* The size of a `long double', as computed by sizeof. */
+#define SIZEOF_LONG_DOUBLE 16
 
-/* The size of a `unsigned long long', as computed by sizeof. */
-#define SIZEOF_UNSIGNED_LONG_LONG 8
+/* The size of a `long long', as computed by sizeof. */
+#define SIZEOF_LONG_LONG 8
 
-/* The size of a `u_int32_t', as computed by sizeof. */
-#define SIZEOF_U_INT32_T 4
+/* The size of a `short', as computed by sizeof. */
+#define SIZEOF_SHORT 2
 
 /* Define to 1 if you have the ANSI C header files. */
 #define STDC_HEADERS 1

Modified: tomcat/connectors/trunk/jk/native/configure.in
URL: http://svn.apache.org/viewcvs/tomcat/connectors/trunk/jk/native/configure.in?rev=406380&r1=406379&r2=406380&view=diff
==============================================================================
--- tomcat/connectors/trunk/jk/native/configure.in (original)
+++ tomcat/connectors/trunk/jk/native/configure.in Sun May 14 10:16:50 2006
@@ -50,34 +50,83 @@
 dnl AC_PATH_PROG(LIBTOOL,libtool,$PATH)dnl
 AC_SUBST(LIBTOOL)
 
-AC_CHECK_SIZEOF(uint32_t)
-AC_CHECK_SIZEOF(u_int32_t)
-AC_CHECK_SIZEOF(unsigned long)
-if test "$ac_cv_sizeof_uint32_t" = "4"; then
-    AC_DEFINE(HAVE_UINT32_T, [], [Use uint32_t for JK_UINT4])
-elif test "$ac_cv_sizeof_u_int32_t" = "4"; then
-    AC_DEFINE(HAVE_U_INT32_T, [], [Use u_int32_t for JK_UINT4])
-elif test "$ac_cv_sizeof_unsigned_long" = "4"; then
-    AC_DEFINE(HAVE_LONG, [], [Use unsigned long for JK_UINT4])
+dnl ----------------------------- Checks for standard typedefs
+
+dnl Checks for integer size
+AC_CHECK_SIZEOF(char, 1)
+AC_CHECK_SIZEOF(int, 4)
+AC_CHECK_SIZEOF(long, 4)
+AC_CHECK_SIZEOF(short, 2)
+AC_CHECK_SIZEOF(long double, 12)
+AC_CHECK_SIZEOF(long long, 8)
+AC_CHECK_SIZEOF(longlong, 8)
+
+# Now we need to find what jk_uint32_t (sizeof == 4) will be.
+# The first match is our preference.
+if test "$ac_cv_sizeof_int" = "4"; then
+    int32_t_fmt='#define JK_INT32_T_FMT "d"'
+    uint32_t_fmt='#define JK_UINT32_T_FMT "u"'
+    uint32_t_hex_fmt='#define JK_UINT32_T_HEX_FMT "x"'
+    int32_value="int"
+elif test "$ac_cv_sizeof_long" = "4"; then
+    int32_t_fmt='#define JK_INT32_T_FMT "ld"'
+    uint32_t_fmt='#define JK_UINT32_T_FMT "lu"'
+    uint32_t_hex_fmt='#define JK_UINT32_T_HEX_FMT "lx"'
+    int32_value="long"
 else
+    int32_t_fmt='#error could not detect a 32-bit integer type'
+    uint32_t_fmt='#error could not detect a 32-bit integer type'
+    uint32_t_hex_fmt='#error could not detect a 32-bit integer type'
     AC_ERROR([could not detect a 32-bit integer type])
 fi
 
-AC_CHECK_SIZEOF(unsigned int)
-AC_CHECK_SIZEOF(unsigned long long)
-AC_CHECK_SIZEOF(unsigned longlong)
-if test "$ac_cv_sizeof_unsigned_int" = "8"; then
-    AC_DEFINE(HAVE_INT64, [], [Use int for JK_UINT8])
-elif test "$ac_cv_sizeof_unsigned_long" = "8"; then
-    AC_DEFINE(HAVE_LONG64, [], [Use long for JK_UINT8])
-elif test "$ac_cv_sizeof_unsigned_long_long" = "8"; then
-    AC_DEFINE(HAVE_LONG_LONG64, [], [Use long long for JK_UINT8])
-elif test "$ac_cv_sizeof_unsigned_longlong" = "8"; then
-    AC_DEFINE(HAVE_LONGLONG64, [], [Use longlong for JK_UINT8])
+# Now we need to find what jk_uint64_t (sizeof == 8) will be.
+# The first match is our preference.
+if test "$ac_cv_sizeof_int" = "8"; then
+    int64_t_fmt='#define JK_INT64_T_FMT "d"'
+    uint64_t_fmt='#define JK_UINT64_T_FMT "u"'
+    uint64_t_hex_fmt='#define JK_UINT64_T_HEX_FMT "x"'
+    int64_value="int"
+elif test "$ac_cv_sizeof_long" = "8"; then
+    int64_t_fmt='#define JK_INT64_T_FMT "ld"'
+    uint64_t_fmt='#define JK_UINT64_T_FMT "lu"'
+    uint64_t_hex_fmt='#define JK_UINT64_T_HEX_FMT "lx"'
+    int64_value="long"
+elif test "$ac_cv_sizeof_long_long" = "8"; then
+    # Linux, Solaris, FreeBSD all support ll with printf.
+    # BSD 4.4 originated 'q'.  Solaris is more popular and 
+    # doesn't support 'q'.  Solaris wins.  Exceptions can
+    # go to the OS-dependent section.
+    int64_t_fmt='#define JK_INT64_T_FMT "lld"'
+    uint64_t_fmt='#define JK_UINT64_T_FMT "llu"'
+    uint64_t_hex_fmt='#define JK_UINT64_T_HEX_FMT "llx"'
+    int64_value="long long"
+elif test "$ac_cv_sizeof_long_double" = "8"; then
+    int64_t_fmt='#define JK_INT64_T_FMT "Ld"'
+    uint64_t_fmt='#define JK_UINT64_T_FMT "Lu"'
+    uint64_t_hex_fmt='#define JK_UINT64_T_HEX_FMT "Lx"'
+    int64_value="long double"
+elif test "$ac_cv_sizeof_longlong" = "8"; then
+    int64_t_fmt='#define JK_INT64_T_FMT "qd"'
+    uint64_t_fmt='#define JK_UINT64_T_FMT "qu"'
+    uint64_t_hex_fmt='#define JK_UINT64_T_HEX_FMT "qx"'
+    int64_value="__int64"
 else
+    int64_t_fmt='#error could not detect a 64-bit integer type'
+    uint64_t_fmt='#error could not detect a 64-bit integer type'
+    uint64_t_hex_fmt='#error could not detect a 64-bit integer type'
     AC_ERROR([could not detect a 64-bit integer type])
 fi
 
+AC_SUBST(int32_value)
+AC_SUBST(int32_t_fmt) 
+AC_SUBST(uint32_t_fmt) 
+AC_SUBST(uint32_t_hex_fmt) 
+AC_SUBST(int64_value)
+AC_SUBST(int64_t_fmt) 
+AC_SUBST(uint64_t_fmt) 
+AC_SUBST(uint64_t_hex_fmt) 
+
 dnl check for snprintf and vsnprintf.
 AC_CHECK_FUNC(snprintf, AC_DEFINE(HAVE_SNPRINTF,1,[Have snprintf()]))
 AC_CHECK_FUNC(vsnprintf, AC_DEFINE(HAVE_VSNPRINTF,1,[Have vsnprintf()]))
@@ -568,5 +617,6 @@
 	apache-2.0/Makefile.apxs
 	common/Makefile
 	common/list.mk
+	common/jk_global.h
 	jni/Makefile
 	])



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message