From owner-p4-projects@FreeBSD.ORG Sat Dec 29 08:03:56 2007 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 0708F16A50D; Sat, 29 Dec 2007 08:03:55 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7B49E16A419 for ; Sat, 29 Dec 2007 08:03:55 +0000 (UTC) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 6656913C4D1 for ; Sat, 29 Dec 2007 08:03:55 +0000 (UTC) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id lBT83tqJ075959 for ; Sat, 29 Dec 2007 08:03:55 GMT (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id lBT83tsN075955 for perforce@freebsd.org; Sat, 29 Dec 2007 08:03:55 GMT (envelope-from peter@freebsd.org) Date: Sat, 29 Dec 2007 08:03:55 GMT Message-Id: <200712290803.lBT83tsN075955@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Cc: Subject: PERFORCE change 131954 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Dec 2007 08:03:56 -0000 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