apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mark benedetto king <...@lowlatency.com>
Subject Re: [PATCH] Fix APR_SSIZE_T_FMT on Darwin.
Date Sun, 02 Oct 2005 21:48:53 GMT
On Sun, Oct 02, 2005 at 03:22:04PM -0400, Jeff Trawick wrote:
> On 10/2/05, mark benedetto king <mbk@spork.local> wrote:
> > Currently, configure generates "%d" for APR_SSIZE_T_FMT on Darwin.
> > This leads to the following warning with gcc -Wall on OS X 10.4:
> 
> What are the definitions of ssize_t on 10.4?

/usr/include/ppc/_types.h:typedef long                 __darwin_ssize_t;
/usr/include/unistd.h:typedef  __darwin_ssize_t        ssize_t;

> 
> Here's what I have on 10.3, where %d is the correct format.
> 
> /usr/include/ppc/ansi.h:#define _BSD_SSIZE_T_   int
> /usr/include/sys/types.h:typedef        _BSD_SSIZE_T_   ssize_t;
> include/apr.h:typedef  ssize_t         apr_ssize_t;
> 

I was afraid of that. :-)

> > Index: configure.in
> > ===================================================================
> > --- configure.in        (revision 263866)
> > +++ configure.in        (working copy)
> > @@ -1349,7 +1349,7 @@
> >          size_t_fmt='#define APR_SIZE_T_FMT "ld"'
> >          ;;
> >      *apple-darwin*)
> > -        ssize_t_fmt='#define APR_SSIZE_T_FMT "d"'
> > +        ssize_t_fmt='#define APR_SSIZE_T_FMT "ld"'
> 
> this has to be auto-detected or be release-dependent

I agree.

configure calls my host "powerpc-apple-darwin-8.2.0".

This new patch works for me, and might not break 10.3.

[[ 
Make configure generate "%ld" for APR_SSIZE_T_FMT on Darwin 8.2.x.
]]

Index: configure.in
===================================================================
--- configure.in	(revision 263866)
+++ configure.in	(working copy)
@@ -1348,6 +1348,10 @@
         ssize_t_fmt='#define APR_SSIZE_T_FMT "ld"'
         size_t_fmt='#define APR_SIZE_T_FMT "ld"'
         ;;
+    *apple-darwin8.2.*)
+        ssize_t_fmt='#define APR_SSIZE_T_FMT "ld"'
+        size_t_fmt='#define APR_SIZE_T_FMT "lu"'
+        ;;
     *apple-darwin*)
         ssize_t_fmt='#define APR_SSIZE_T_FMT "d"'
         size_t_fmt='#define APR_SIZE_T_FMT "lu"'

Mime
View raw message