Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiler warnings when included in conjunction with VS2010's stdint.h. #10

Closed
GoogleCodeExporter opened this issue Mar 4, 2016 · 2 comments

Comments

@GoogleCodeExporter
Copy link

Steps to reproduce:
In Visual Studio 2010, create an application that includes stdint.h from 
msinttypes as well as the compiler's included stdint.h.

Attempt to build it. You will receive several compiler warnings about 
redefinition of macros, typedefs, etc.

Solution:
Within stdint.h, if the compiler provides its own stdint.h, include the 
compiler's version rather than manually defining everything, e.g...

#ifndef _MSC_VER // [
#error "Use this header only with Microsoft Visual C++ compilers!"
#endif // _MSC_VER ]

#ifndef _MSC_STDINT_H_ // [
#define _MSC_STDINT_H_

#if _MSC_VER > 1000
#pragma once
#endif

#if _MSC_VER >= 1600

#include <stdint.h>

#else

// ...remainder of file...

#endif

Original issue reported on code.google.com by louse...@gmail.com on 5 Jan 2011 at 9:58

@GoogleCodeExporter
Copy link
Author

Fyi, Visual Studio 2010 provides stdint.h but not inttypes.h. So inttypes.h 
does not need changed.

Original comment by louse...@gmail.com on 5 Jan 2011 at 10:01

@GoogleCodeExporter
Copy link
Author

Commited as r28. Thank you!

Original comment by alexander.chemeris on 24 May 2013 at 10:32

  • Changed state: Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant