diff --git a/include/llvm/Support/DataTypes.h.cmake b/include/llvm/Support/DataTypes.h.cmake index 7484abd3686..1dcec0588fa 100644 --- a/include/llvm/Support/DataTypes.h.cmake +++ b/include/llvm/Support/DataTypes.h.cmake @@ -101,7 +101,11 @@ typedef short int16_t; typedef unsigned short uint16_t; typedef signed char int8_t; typedef unsigned char uint8_t; -typedef signed int ssize_t; +#if defined(_WIN64) + typedef signed __int64 ssize_t; +#else + typedef signed int ssize_t; +#endif #ifndef INT8_MAX # define INT8_MAX 127 #endif diff --git a/include/llvm/Support/DataTypes.h.in b/include/llvm/Support/DataTypes.h.in index b9fb48a1d49..d6c38169504 100644 --- a/include/llvm/Support/DataTypes.h.in +++ b/include/llvm/Support/DataTypes.h.in @@ -98,7 +98,12 @@ typedef short int16_t; typedef unsigned short uint16_t; typedef signed char int8_t; typedef unsigned char uint8_t; -typedef signed int ssize_t; +#if defined(_WIN64) + typedef signed __int64 ssize_t; +#else + typedef signed long ssize_t; +#endif + #ifndef INT8_MAX # define INT8_MAX 127 #endif