diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 6504a1b..37cb30f 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -29,8 +29,8 @@ else() list(APPEND SOURCES io_nix.c) endif() -if(MSVC) - list(APPEND API ../msvc-stdint/stdint.h) +if(MSVC AND MSVC_VERSION LESS 1600) + list(APPEND API wiiuse_msvcstdint.h) endif() add_library(wiiuse SHARED ${SOURCES} ${API}) diff --git a/src/wiiuse.h b/src/wiiuse.h index 62bb0bc..64f67a6 100644 --- a/src/wiiuse.h +++ b/src/wiiuse.h @@ -76,7 +76,12 @@ #define WCONST const #endif -#include +#if defined(_MSC_VER) && (_MSC_VER < 1600) +/* MS compilers of pre-VC2010 versions don't have stdint.h */ + #include +#else + #include +#endif /* led bit masks */ #define WIIMOTE_LED_NONE 0x00 diff --git a/src/wiiuse_internal.h b/src/wiiuse_internal.h index 3ab3264..d21fc55 100644 --- a/src/wiiuse_internal.h +++ b/src/wiiuse_internal.h @@ -51,7 +51,12 @@ #include "definitions.h" -#include +#if defined(_MSC_VER) && (_MSC_VER < 1600) +/* MS compilers of pre-VC2010 versions don't have stdint.h */ + #include +#else + #include +#endif /******************** * diff --git a/msvc-stdint/stdint.h b/src/wiiuse_msvcstdint.h similarity index 100% rename from msvc-stdint/stdint.h rename to src/wiiuse_msvcstdint.h