Chia-I Wu <olva...@gmail.com> writes:
> On Mon, Jul 27, 2009 at 10:07:37AM -0600, tom fogal wrote:
> > >  /**
> > > + * Get standard integer types
> > > + */
> > > +#if defined(_MSC_VER)
> > > +   typedef __int8             int8_t;
> > > +   typedef unsigned __int8    uint8_t;
> > [snip]
> > > +#else
> > > +#  include <stdint.h>
> > > +#endif
> > I think this would make more sense predicated on __STDC_VERSION__
> > compared to 199901L (i.e. c99 path and non-c99 path).
>
> This is the part of C that I never know how to do right, and therefore I
> stole it from mesa/main/compiler.h.
> 
> I read it as
> 
> #if defined(_MSC_VER)
> /* some typedefs */
> #elif (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L)
> #include <stdint.h>
> #else
> /* no better way, hope the best */
> #include <stdint.h>
> #endif

Hrm.  I would argue that both places should read something more like:

  #if C99 is supported
  #   include <stdint.h>
  #else
      /* some typedefs */
  #endif

Or perhaps something more robust / maintained by a third party entity
(like the `msinttypes' project you mention; boost has a similar header
which probably isn't C++-specific; I'm sure there's others out there)
could be integrated.

Anyway, presumably the above #if sequence would "just work" when
(if?) MS finally decides to support enough C99 to update that define.

-tom

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Mesa3d-dev mailing list
Mesa3d-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev

Reply via email to