[flac-dev] [PATCH] Remove even more CPP hackery

Erik de Castro Lopo mle+la at mega-nerd.com
Wed Feb 8 01:32:10 PST 2012


Dave Yeo wrote:

> Another try

Actually there are still some issues with this patch,  mainly around
your changes to incluce/FLAC/ordinals.h. This file is a public header
file and hence, your changes:

    diff --git a/include/FLAC/ordinals.h b/include/FLAC/ordinals.h
    index 80d055b..dc2dafc 100644
    --- a/include/FLAC/ordinals.h
    +++ b/include/FLAC/ordinals.h
    @@ -32,10 +32,18 @@
     #ifndef FLAC__ORDINALS_H
     #define FLAC__ORDINALS_H
     
    -#if !(defined(_MSC_VER) || defined(__BORLANDC__) || defined(__EMX__))
    +#if HAVE_CONFIG_H
    +#  include <config.h>
    +#endif
    +
    +#if !(defined(_MSC_VER) || defined(__BORLANDC__))
     #include <inttypes.h>
     #endif
     
    +#if HAVE_STDINT_H
    +#include <stdint.h>
    +#endif
    +
     typedef signed char FLAC__int8;
     typedef unsigned char FLAC__uint8;
 
rely on "config.h" which is only available when FLAC is compiled,
not when this file is installed in /usr/include/FLAC or whereever.

I'll accept the rest of the patch. For the problem of this file,
I think the best solution is to just remove all the CPP hackery
and assume that a C99 <stdint.h> is available. THis would then
make it incumbent on any developer that includes (either directly
or indirectly) include/FLAC/ordinals.h to include some version
of <stdint.h> first, even if it is just a mininal one with
typedefs for the minimal set of sized ints.

Does that make sense?

Erik
-- 
----------------------------------------------------------------------
Erik de Castro Lopo
http://www.mega-nerd.com/


More information about the flac-dev mailing list