After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 652227 - Unconditional use of stdint.h
Unconditional use of stdint.h
Status: RESOLVED FIXED
Product: pango
Classification: Platform
Component: general
1.28.x
Other Solaris
: Normal normal
: ---
Assigned To: pango-maint
pango-maint
Depends on:
Blocks:
 
 
Reported: 2011-06-09 18:45 UTC by Dagobert Michelsen
Modified: 2011-06-11 03:08 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Use inttypes.h if stdint.h is not available (749 bytes, patch)
2011-06-09 19:05 UTC, Dagobert Michelsen
none Details | Review

Description Dagobert Michelsen 2011-06-09 18:45:31 UTC
In one location stdint.h is included unconditionally although presence and alternative inttypes.h may have been detected. The attached patch fixes the issue.
Comment 1 Behdad Esfahbod 2011-06-09 19:03:42 UTC
Forgot to attach?
Comment 2 Dagobert Michelsen 2011-06-09 19:05:34 UTC
Created attachment 189575 [details] [review]
Use inttypes.h if stdint.h is not available
Comment 3 Behdad Esfahbod 2011-06-09 19:11:10 UTC
Humm.  We cannot meaningfully use the HAVE_* macros there.  It would work in Pango, but not in upstream harfbuzz, since that header will be included by harfbuzz users.  Perhaps we should detect what header defines the int types and include that in a generated hb-config.h or something.
Comment 4 Soren Sandmann Pedersen 2011-06-10 21:27:05 UTC
FWIW, pixman has this:

    #if !defined (PIXMAN_DONT_DEFINE_STDINT)

    #if defined (_SVR4) || defined (SVR4) || defined (__OpenBSD__) || defined (_sgi) || defined (__sun) || defined (sun) || defined (__digital__) || defined (__HP_cc)
    #  include <inttypes.h>
    /* VS 2010 (_MSC_VER 1600) has stdint.h */
    #elif defined (_MSC_VER) && _MSC_VER < 1600
    typedef __int8 int8_t;
    typedef unsigned __int8 uint8_t;
    typedef __int16 int16_t;
    typedef unsigned __int16 uint16_t;
    typedef __int32 int32_t;
    typedef unsigned __int32 uint32_t;
    typedef __int64 int64_t;
    typedef unsigned __int64 uint64_t;
    #elif defined (_AIX)
    #  include <sys/inttypes.h>
    #else
    #  include <stdint.h>
    #endif

    #endif

so that is good enough for everywhere X11 runs.
Comment 5 Behdad Esfahbod 2011-06-11 03:08:38 UTC
Thanks, I committed the original patch to Pango, and Søren's to HarfBuzz upstream.