How does the header stdint.h define u32 to be 32 bits on every machine? Could somebody elaborate on the process that stdint.h does to make this happen? Where can I find my machine’s (Windows 7) stdint.h file?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
stdint.h is in the C99 (and VC++ of versions below 2008 only implements C89), so to have this file on a Win7 machine you need either VisualStudio 2010 (or later) installed. Then this file is in the “VC\include\stdint.h” folder of your MSVS installation.
MinGW (gcc toolchain for Win32) and Cygwin (POSIX layer for windows machines) also include the stdint.h file in their “include” directory.
To your question: the “magic” behind uintN_t types is typically implemented using conditional compilation. There may be some symbols predefined (by the compiler), like _WIN32 on Windows and _WIN64 for x64 targets.
For the pre-2008 versions of VisualStudio there’s a separate stdint.h implementation: http://msinttypes.googlecode.com/svn/trunk/stdint.h