shiyilei / protobuf-c

Automatically exported from code.google.com/p/protobuf-c
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Windows needs inttypes.h #41

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Make Visual Studio project and compile
2. Requires inttypes.h. Not part of Vis-C.
3.

What is the expected output? What do you see instead?
No compile errors.

What version of the product are you using? On what operating system?
0.13

Please provide any additional information below.
I included stdint.h and inttypes.h from  http://code.google.com/p/msinttypes/

Original issue reported on code.google.com by chinbill...@gmail.com on 9 Jun 2010 at 12:19

GoogleCodeExporter commented 8 years ago
Sorry, what I saw instead were missing int types (uint64 I think).

Original comment by chinbill...@gmail.com on 9 Jun 2010 at 12:20

GoogleCodeExporter commented 8 years ago
Also, I think this a Microsoft Visual Studio issue rather than all of Windows. 
Cygwin & Ming probably work. Not sure about other compilers.

Original comment by chinbill...@gmail.com on 9 Jun 2010 at 1:38

GoogleCodeExporter commented 8 years ago
I committed a hack to protobuf-c.h... tell me if it works out:
#ifndef PROTOBUF_C_SKIP_INTTYPES_H
#  if defined(_MSC_VER)
     /* On windows, in ms visual studio, define the types ourselves */
#    define int32_t      signed __int32
#    define uint32_t     unsigned __int32
#    define int64_t      signed __int64
#    define uint64_t     unsigned __int64
#    define uint8_t      unsigned char
#  else
     /* Use the system inttypes.h */
#    include <inttypes.h>
#  endif
#endif

Original comment by lahike...@gmail.com on 26 Aug 2010 at 4:14

GoogleCodeExporter commented 8 years ago
should be resolved by Nikita Manovich's patch.

Original comment by lahike...@gmail.com on 10 Mar 2011 at 10:44