Mercurial > hg
comparison mercurial/compat.h @ 39610:11ed2eadf937
cext: fix warnings when building for py3 on Windows
MSVC++ 14 now has standard int types that don't need to be redefined (I didn't
go back to see when they came along since the build system wants either 2008 or
2015), but doesn't have ssize_t. The FILE pointer in posixfile is only used on
python2.
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Thu, 13 Sep 2018 17:32:20 -0400 |
parents | f4433f2713d0 |
children | d86908050375 |
comparison
equal
deleted
inserted
replaced
39609:c06c585f166b | 39610:11ed2eadf937 |
---|---|
1 #ifndef _HG_COMPAT_H_ | 1 #ifndef _HG_COMPAT_H_ |
2 #define _HG_COMPAT_H_ | 2 #define _HG_COMPAT_H_ |
3 | 3 |
4 #ifdef _WIN32 | 4 #ifdef _WIN32 |
5 #ifdef _MSC_VER | 5 #ifdef _MSC_VER |
6 #if _MSC_VER < 1900 | |
6 /* msvc 6.0 has problems */ | 7 /* msvc 6.0 has problems */ |
7 #define inline __inline | 8 #define inline __inline |
8 #if defined(_WIN64) | 9 #if defined(_WIN64) |
9 typedef __int64 ssize_t; | 10 typedef __int64 ssize_t; |
10 typedef unsigned __int64 uintptr_t; | 11 typedef unsigned __int64 uintptr_t; |
19 typedef unsigned char uint8_t; | 20 typedef unsigned char uint8_t; |
20 typedef unsigned short uint16_t; | 21 typedef unsigned short uint16_t; |
21 typedef unsigned long uint32_t; | 22 typedef unsigned long uint32_t; |
22 typedef unsigned __int64 uint64_t; | 23 typedef unsigned __int64 uint64_t; |
23 #else | 24 #else |
25 /* VC++ 14 */ | |
26 #include <stdint.h> | |
27 | |
28 #if defined(_WIN64) | |
29 typedef __int64 ssize_t; | |
30 #else | |
31 typedef int ssize_t; | |
32 #endif | |
33 #endif /* _MSC_VER < 1900 */ | |
34 | |
35 #else | |
36 /* not msvc */ | |
24 #include <stdint.h> | 37 #include <stdint.h> |
25 #endif | 38 #endif |
26 #else | 39 #else |
27 /* not windows */ | 40 /* not windows */ |
28 #include <sys/types.h> | 41 #include <sys/types.h> |