[prev in list] [next in list] [prev in thread] [next in thread] 

List:       apr-dev
Subject:    Re: 64 and 32 bit compile
From:       Igor_Galić <i.galic () brainsware ! org>
Date:       2010-06-28 23:32:28
Message-ID: 1363158001.924.1277767948057.JavaMail.root () iris
[Download RAW message or body]


</snip>
> The sanest way to work around this would be to actually use the
> included stdint.h's int32_t and int64_t, if configure determines
> it exists.
> 
> What's left to deal with then are the FMTs, but there's inttypes.h
> to take care of that.

I've been looking long and hard on build/aprenv.py and it looks
profoundly convoluted.

I would propose to check for stdint.h/*int*_t and if that exists go
with it, all the way. Same for inttypes.h/FMT -- only if these don't
exist (not C99 compliant, or C++) fall back to the mess that currently
constitutes build/aprenv.py

if conf.CheckTypeSize('int64_t', includes='#include <stdint.h>'):
  subst['@long_value@'] = 'int64_t'
  subst['@int_value@'] = 'int32_t'
  subst['@short_value@'] = 'int16_t'
  subst['@stdint@'] = 1

And
  
if conf.CheckDeclaration('PRIi64', includes='#include <inttypes.h>'):
  subst['@int64_t_fmt@'] = '#define APR_INT64_T_FMT PRId64'
  subst['@uint64_t_fmt@'] = '#define APR_UINT64_T_FMT PRIu64'
  subst['@uint64_t_hex_fmt@'] = '#define APR_UINT64_T_HEX_FMT PRIx64'
  subst['@inttypes@'] = 1


Not quite sure entire how to put the whole thing into a coherent picture.
So no patch as of yet. 

-- 
Igor Galić

Tel: +43 (0) 699 122 96 338
Fax: +43(0) 1 91 333 41
Mail: i.galic@brainsware.org
URL: http://brainsware.org/

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic