RPM Community Forums

Mailing List Message of <rpm-devel>

Re: [CVS] RPM: rpm-5_1: rpm/rpmio/ argv.h

From: Arkadiusz Miskiewicz <arekm@rpm5.org>
Date: Wed 30 Jul 2008 - 08:59:49 CEST
Message-Id: <200807300859.49605.arekm@rpm5.org>
On Wednesday 30 July 2008, Ralf S. Engelschall wrote:
> On Tue, Jul 29, 2008, Arkadiusz Miskiewicz wrote:
> > On Tuesday 29 July 2008, Ralf S. Engelschall wrote:
> > > On Tue, Jul 29, 2008, Arkadiusz Miskiewicz wrote:
> > > > type of solution. Does that work for you?
> > >
> > > In general I'm ok with an approach which punishes only
> > > old/obsolete/deprecated/whatever platforms. But in this case I'm more
> > > thinking about neither distinguishing between old and new and more
> > > about mostly feature based testing:
> > >
> > > #ifdef HAVE_CONFIG_H
> > > #include "config.h"
> > > #endif
> > > #if defined(HAVE_STDINT_H) || (defined(__STDC_VERSION__) &&
> > > __STDC_VERSION__+0 >= 199901L) #include <stdint.h>
> > > #endif
> > > #if defined(HAVE_INTTYPES_H)
> > > #include <inttypes.h>
> > > #endif
> >
> > This approach works fine for building rpm itself but it doesn't work when
> > you are building external app that doesn't use autoconf and that app
> > includes rpm public headers.
>
> Why? The above particular code makes sure that as long as the external
> app is using a "modern compiler" (which supports C99) _NOTHING_ has do
> be explicitly done at all. It just seemlessly will include <stdint.h>
> and fine. Notice the "||" above, please. Only if you build on an older
> compiler you have to provide the #defines. That is what I thought is
> what you wished...

Ah, sorry. That way is fine for me, too.

>                                        Ralf S. Engelschall

-- 
Arkadiusz Miƛkiewicz        PLD/Linux Team
arekm / maven.pl            http://ftp.pld-linux.org/
Received on Wed Jul 30 08:59:51 2008
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.