httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jim Jagielski <...@devsys.jaguNET.com>
Subject Re: Can we get rid of %qd?
Date Fri, 21 May 1999 21:20:53 GMT
Jim Jagielski wrote:
> 
> Ralf S. Engelschall wrote:
> > 
> > 
> > In article <Pine.LNX.3.96dg4.990521091505.13415I-100000@twinlark.arctic.org>
you wrote:
> > 
> > >> We can certainly see if 'long long' is supported under the [cC]onfigure
> > >> process and have some code in ap_snprintf() that handles it if
> > >> possible.
> > > 
> > > That sounds like a good idea.
> > 
> > Yes, this would be a clean solutions, +1 for this approach.
> > 
> 
> I would think that the "best" approach would be for those platforms
> that support 'long long' (which is what quad_t is under FreeBSD) that
> %q uses that. For those that don't, %q is silently ignored. Make
> sense?
> 

Hold on... the real issue is the size of st_size... If we're on 32
bits machines, then we can see if sizeof(st_size) is 8, and if
so use %qd; if it's 4 then we use assume it's a long so we'd use
%ld. We can't just see if 'long long' is supported and, if it
is, assume st_size is that size...

So the logic should be:

   1. Get sizeof long
   2. Get sizeof off_t
   3. If the same, then can "map" AP_QUAD_T to long. So %qd would
      be the exact same as %ld
   4. If off_t is larger, then we assume that long long is
      available and so map AP_QUAD_T to that.

-- 
===========================================================================
   Jim Jagielski   |||   jim@jaguNET.com   |||   http://www.jaguNET.com/
            "That's no ordinary rabbit... that's the most foul,
            cruel and bad-tempered rodent you ever laid eyes on"

Mime
View raw message