i try to compile simple c/c++ app that is using http_parser from node.js i also using libuv , and basically trying to compile this example in windows. using visual studio 2008
but i getting this compilation error :
>d:\dev\cpp\servers\libuv\libuv_http_server\http_parser.h(35) : error C2371: 'int8_t' : redefinition; different basic types
1> d:\dev\cpp\servers\libuv\libuv-master\libuv-master\include\uv-private\stdint-msvc2008.h(82) : see declaration of 'int8_t'
the code in the http_parser.h file looks like this:
#include <sys/types.h>
#if defined(_WIN32) && !defined(__MINGW32__) && (!defined(_MSC_VER) || _MSC_VER<1600)
#include <BaseTsd.h>
#include <stddef.h>
//#undef __int8
typedef __int8 int8_t;
typedef unsigned __int8 uint8_t;
typedef __int16 int16_t;
typedef unsigned __int16 uint16_t;
typedef __int32 int32_t;
typedef unsigned __int32 uint32_t;
typedef __int64 int64_t;
typedef unsigned __int64 uint64_t;
#else
#include <stdint.h>
#endif
as you can see i tryed to undef it but it didnt worked. what can i do so it will pass compilation . if i just remove it im getting this error :
http_parser.c(180) : error C2061: syntax error : identifier 'unhex'
on this code section :
static const int8_t unhex[256] =
{-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1
,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1
,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1
, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,-1,-1,-1,-1,-1,-1
,-1,10,11,12,13,14,15,-1,-1,-1,-1,-1,-1,-1,-1,-1
,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1
,-1,10,11,12,13,14,15,-1,-1,-1,-1,-1,-1,-1,-1,-1
,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1
};
and many other sections that using int8_t