Date: Sat, 29 Dec 2007 08:03:55 GMT From: Peter Wemm <peter@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 131954 for review Message-ID: <200712290803.lBT83tsN075955@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=131954 Change 131954 by peter@peter_repocopy on 2007/12/29 08:03:36 Make portable across 32 vs 64 bit. Affected files ... .. //depot/projects/hammer/lib/libapr/apr.h#2 edit .. //depot/projects/hammer/lib/libapr/apr_private.h#2 edit Differences ... ==== //depot/projects/hammer/lib/libapr/apr.h#2 (text+ko) ==== @@ -265,8 +265,13 @@ typedef int apr_int32_t; typedef unsigned int apr_uint32_t; +#ifdef _LP64 typedef long apr_int64_t; typedef unsigned long apr_uint64_t; +#else +typedef long long apr_int64_t; +typedef unsigned long long apr_uint64_t; +#endif typedef size_t apr_size_t; typedef ssize_t apr_ssize_t; @@ -281,7 +286,11 @@ */ #define apr_ino_t apr_ino_t__requires__apr_file_info_h +#ifdef _LP64 #define APR_SIZEOF_VOIDP 8 +#else +#define APR_SIZEOF_VOIDP 4 +#endif /* Are we big endian? */ #define APR_IS_BIGENDIAN 0 @@ -355,25 +364,49 @@ * to find the logic for this definition search for "ssize_t_fmt" in * configure.in. */ +#ifdef _LP64 #define APR_SSIZE_T_FMT "ld" +#else +#define APR_SSIZE_T_FMT "d" +#endif /* And APR_SIZE_T_FMT */ +#ifdef _LP64 #define APR_SIZE_T_FMT "ld" +#else +#define APR_SIZE_T_FMT "d" +#endif /* And APR_OFF_T_FMT */ +#ifdef _LP64 #define APR_OFF_T_FMT "ld" +#else +#define APR_OFF_T_FMT APR_INT64_T_FMT +#endif /* And APR_PID_T_FMT */ #define APR_PID_T_FMT "d" /* And APR_INT64_T_FMT */ +#ifdef _LP64 #define APR_INT64_T_FMT "ld" +#else +#define APR_INT64_T_FMT "lld" +#endif /* And APR_UINT64_T_FMT */ +#ifdef _LP64 #define APR_UINT64_T_FMT "lu" +#else +#define APR_UINT64_T_FMT "llu" +#endif /* And APR_UINT64_T_HEX_FMT */ +#ifdef _LP64 #define APR_UINT64_T_HEX_FMT "lx" +#else +#define APR_UINT64_T_HEX_FMT "llx" +#endif /* Does the proc mutex lock threads too */ #define APR_PROC_MUTEX_IS_GLOBAL 0 ==== //depot/projects/hammer/lib/libapr/apr_private.h#2 (text+ko) ==== @@ -3,10 +3,18 @@ /* Define as function which can be used for conversion of strings to apr_int64_t */ +#ifdef _LP64 #define APR_INT64_STRFN strtol +#else +#define APR_INT64_STRFN strtoll +#endif /* Define as function used for conversion of strings to apr_off_t */ +#ifdef _LP64 #define APR_OFF_T_STRFN strtol +#else +#define APR_OFF_T_STRFN strtoll +#endif /* Define to path of random device */ #define DEV_RANDOM "/dev/random" @@ -670,7 +678,11 @@ #define SIZEOF_INT 4 /* The size of `long', as computed by sizeof. */ +#ifdef _LP64 #define SIZEOF_LONG 8 +#else +#define SIZEOF_LONG 4 +#endif /* The size of `long long', as computed by sizeof. */ #define SIZEOF_LONG_LONG 8 @@ -685,13 +697,25 @@ #define SIZEOF_SHORT 2 /* The size of size_t */ +#ifdef _LP64 #define SIZEOF_SIZE_T 8 +#else +#define SIZEOF_SIZE_T 4 +#endif /* The size of ssize_t */ +#ifdef _LP64 #define SIZEOF_SSIZE_T 8 +#else +#define SIZEOF_SSIZE_T 4 +#endif /* The size of `void*', as computed by sizeof. */ +#ifdef _LP64 #define SIZEOF_VOIDP 8 +#else +#define SIZEOF_VOIDP 4 +#endif /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200712290803.lBT83tsN075955>