libimobiledevice / libplist

A library to handle Apple Property List format in binary or XML
https://libimobiledevice.org
GNU Lesser General Public License v2.1
535 stars 304 forks source link

redefine of uint8_t on windows with msvc #117

Closed zhaohuaxishi closed 5 years ago

zhaohuaxishi commented 6 years ago

i found following code in plist/plist.h

#ifdef _MSC_VER
    typedef __int8 int8_t;
    typedef __int16 int16_t;
    typedef __int32 int32_t;
    typedef __int64 int64_t;

    typedef unsigned __int8 uint8_t;
    typedef unsigned __int16 uint16_t;
    typedef unsigned __int32 uint32_t;
    typedef unsigned __int64 uint64_t;

#else
#include <stdint.h>
#endif

which cause my msvc to complain about redefine of int8_t and the value of _MSC_VER is 1912.

i don't know the first version that offer ,but according to this page, Visual Studio 2012 already shipped with cstdint.

may be #if _MSC_VER && _MSC_VER < 1700 will be better than just #ifdef _MSC_VER

nikias commented 5 years ago

Without further checking I pushed this with commit afec7339b830461042e5af9cb9561563cf3ba28d.