[PATCH] Fix standard integer definitions for MSVC in DataTypes.h

Zachary Turner zturner at google.com
Tue May 27 12:20:19 PDT 2014


This was actually my original approach until I searched around online.  One
example of a report of a user not being able to find stdint.h on VS2012 is
here: https://code.google.com/p/msinttypes/issues/detail?id=12

That being said, i did in fact do a vanilla install of VS2012 and confirmed
that the file was there.  So I really don't know how to explain that
person's experience.  Maybe a pre-release version of VS2012?  You can find
more reports of people not having stdint.h by doing a quick google search
for "visual studio 2012 stdint.h".

I would also prefer to remove all of this, so if everyone is still ok with
this, I will change the patch accordingly.


On Tue, May 27, 2014 at 11:33 AM, Aaron Ballman <aaron at aaronballman.com>wrote:

> On Tue, May 27, 2014 at 2:30 PM, Reid Kleckner <rnk at google.com> wrote:
> > +Nakamura, he knows more about the various supported Windows configs.
> >
> > Thanks!  At one point I thought I could delete DataTypes.h completely in
> > favor of stdint.h, but I gave up because inttypes.h makes things
> > complicated.
> >
> > +#if defined(_WIN64)
> > +typedef signed __int64 ssize_t;
> > +#else
> > +typedef signed int ssize_t;
> > +#endif /* _WIN64 */
> > +
> > +/* Ideally, we would like to assume that stdint.h always exists on
> > +   every supported Visual Studio version.  Indeed, the header does get
> > +   installed on a vanilla VS 2012 installation.  But a search online
> > +   shows that some people seem to have a version of VS2012 that does
> > +   not have this header, so without a better understanding of why this
> > +   is it's better to leave this check in. */
> > +#ifndef HAVE_STDINT_H
> >
> > Really?  I thought it was available since VS 2010.  Do you have a link to
> > these results?  I'd like to nuke this, replace it with '#error "MSVC must
> > provide stdint.h"', commit it, and see if it sticks.
>
> stdint.h is included with MSVC 2010 and later. I concur with the
> #error approach.
>
> ~Aaron
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140527/baeda158/attachment.html>


More information about the llvm-commits mailing list