Mercurial > hg
annotate mercurial/compat.h @ 32983:0d757af1ea67
configitems: add a basic class to hold config item information
The goal of this class is allow explicit declaration for the available config
option. This class will hold the data for one specific config item.
To keep it simple we start centralizing the handling of the default config value.
In the future we can expect more data to be carried on this class. For example:
- documentation,
- status (experimental, advanced, normal, deprecated),
- aliases,
- expected type,
- etc...
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Sat, 17 Jun 2017 18:41:55 +0200 |
parents | 7b22599dcb85 |
children | f4433f2713d0 |
rev | line source |
---|---|
29444
284d742e5611
internals: move the bitmanipulation routines into its own file
Maciej Fijalkowski <fijall@gmail.com>
parents:
diff
changeset
|
1 #ifndef _HG_COMPAT_H_ |
284d742e5611
internals: move the bitmanipulation routines into its own file
Maciej Fijalkowski <fijall@gmail.com>
parents:
diff
changeset
|
2 #define _HG_COMPAT_H_ |
284d742e5611
internals: move the bitmanipulation routines into its own file
Maciej Fijalkowski <fijall@gmail.com>
parents:
diff
changeset
|
3 |
284d742e5611
internals: move the bitmanipulation routines into its own file
Maciej Fijalkowski <fijall@gmail.com>
parents:
diff
changeset
|
4 #ifdef _WIN32 |
284d742e5611
internals: move the bitmanipulation routines into its own file
Maciej Fijalkowski <fijall@gmail.com>
parents:
diff
changeset
|
5 #ifdef _MSC_VER |
284d742e5611
internals: move the bitmanipulation routines into its own file
Maciej Fijalkowski <fijall@gmail.com>
parents:
diff
changeset
|
6 /* msvc 6.0 has problems */ |
284d742e5611
internals: move the bitmanipulation routines into its own file
Maciej Fijalkowski <fijall@gmail.com>
parents:
diff
changeset
|
7 #define inline __inline |
29521
83147ff53112
compat: provide a declaration of ssize_t, for MS windows
Maciej Fijalkowski <fijall@gmail.com>
parents:
29444
diff
changeset
|
8 #if defined(_WIN64) |
83147ff53112
compat: provide a declaration of ssize_t, for MS windows
Maciej Fijalkowski <fijall@gmail.com>
parents:
29444
diff
changeset
|
9 typedef __int64 ssize_t; |
83147ff53112
compat: provide a declaration of ssize_t, for MS windows
Maciej Fijalkowski <fijall@gmail.com>
parents:
29444
diff
changeset
|
10 #else |
29549
7b22599dcb85
compat: define ssize_t as int on 32bit Windows, silences C4142 warning
Yuya Nishihara <yuya@tcha.org>
parents:
29521
diff
changeset
|
11 typedef int ssize_t; |
29521
83147ff53112
compat: provide a declaration of ssize_t, for MS windows
Maciej Fijalkowski <fijall@gmail.com>
parents:
29444
diff
changeset
|
12 #endif |
29444
284d742e5611
internals: move the bitmanipulation routines into its own file
Maciej Fijalkowski <fijall@gmail.com>
parents:
diff
changeset
|
13 typedef signed char int8_t; |
284d742e5611
internals: move the bitmanipulation routines into its own file
Maciej Fijalkowski <fijall@gmail.com>
parents:
diff
changeset
|
14 typedef short int16_t; |
284d742e5611
internals: move the bitmanipulation routines into its own file
Maciej Fijalkowski <fijall@gmail.com>
parents:
diff
changeset
|
15 typedef long int32_t; |
284d742e5611
internals: move the bitmanipulation routines into its own file
Maciej Fijalkowski <fijall@gmail.com>
parents:
diff
changeset
|
16 typedef __int64 int64_t; |
284d742e5611
internals: move the bitmanipulation routines into its own file
Maciej Fijalkowski <fijall@gmail.com>
parents:
diff
changeset
|
17 typedef unsigned char uint8_t; |
284d742e5611
internals: move the bitmanipulation routines into its own file
Maciej Fijalkowski <fijall@gmail.com>
parents:
diff
changeset
|
18 typedef unsigned short uint16_t; |
284d742e5611
internals: move the bitmanipulation routines into its own file
Maciej Fijalkowski <fijall@gmail.com>
parents:
diff
changeset
|
19 typedef unsigned long uint32_t; |
284d742e5611
internals: move the bitmanipulation routines into its own file
Maciej Fijalkowski <fijall@gmail.com>
parents:
diff
changeset
|
20 typedef unsigned __int64 uint64_t; |
284d742e5611
internals: move the bitmanipulation routines into its own file
Maciej Fijalkowski <fijall@gmail.com>
parents:
diff
changeset
|
21 #else |
284d742e5611
internals: move the bitmanipulation routines into its own file
Maciej Fijalkowski <fijall@gmail.com>
parents:
diff
changeset
|
22 #include <stdint.h> |
284d742e5611
internals: move the bitmanipulation routines into its own file
Maciej Fijalkowski <fijall@gmail.com>
parents:
diff
changeset
|
23 #endif |
284d742e5611
internals: move the bitmanipulation routines into its own file
Maciej Fijalkowski <fijall@gmail.com>
parents:
diff
changeset
|
24 #else |
284d742e5611
internals: move the bitmanipulation routines into its own file
Maciej Fijalkowski <fijall@gmail.com>
parents:
diff
changeset
|
25 /* not windows */ |
284d742e5611
internals: move the bitmanipulation routines into its own file
Maciej Fijalkowski <fijall@gmail.com>
parents:
diff
changeset
|
26 #include <sys/types.h> |
284d742e5611
internals: move the bitmanipulation routines into its own file
Maciej Fijalkowski <fijall@gmail.com>
parents:
diff
changeset
|
27 #if defined __BEOS__ && !defined __HAIKU__ |
284d742e5611
internals: move the bitmanipulation routines into its own file
Maciej Fijalkowski <fijall@gmail.com>
parents:
diff
changeset
|
28 #include <ByteOrder.h> |
284d742e5611
internals: move the bitmanipulation routines into its own file
Maciej Fijalkowski <fijall@gmail.com>
parents:
diff
changeset
|
29 #else |
284d742e5611
internals: move the bitmanipulation routines into its own file
Maciej Fijalkowski <fijall@gmail.com>
parents:
diff
changeset
|
30 #include <arpa/inet.h> |
284d742e5611
internals: move the bitmanipulation routines into its own file
Maciej Fijalkowski <fijall@gmail.com>
parents:
diff
changeset
|
31 #endif |
284d742e5611
internals: move the bitmanipulation routines into its own file
Maciej Fijalkowski <fijall@gmail.com>
parents:
diff
changeset
|
32 #include <inttypes.h> |
284d742e5611
internals: move the bitmanipulation routines into its own file
Maciej Fijalkowski <fijall@gmail.com>
parents:
diff
changeset
|
33 #endif |
284d742e5611
internals: move the bitmanipulation routines into its own file
Maciej Fijalkowski <fijall@gmail.com>
parents:
diff
changeset
|
34 |
284d742e5611
internals: move the bitmanipulation routines into its own file
Maciej Fijalkowski <fijall@gmail.com>
parents:
diff
changeset
|
35 #if defined __hpux || defined __SUNPRO_C || defined _AIX |
284d742e5611
internals: move the bitmanipulation routines into its own file
Maciej Fijalkowski <fijall@gmail.com>
parents:
diff
changeset
|
36 #define inline |
284d742e5611
internals: move the bitmanipulation routines into its own file
Maciej Fijalkowski <fijall@gmail.com>
parents:
diff
changeset
|
37 #endif |
284d742e5611
internals: move the bitmanipulation routines into its own file
Maciej Fijalkowski <fijall@gmail.com>
parents:
diff
changeset
|
38 |
284d742e5611
internals: move the bitmanipulation routines into its own file
Maciej Fijalkowski <fijall@gmail.com>
parents:
diff
changeset
|
39 #ifdef __linux |
284d742e5611
internals: move the bitmanipulation routines into its own file
Maciej Fijalkowski <fijall@gmail.com>
parents:
diff
changeset
|
40 #define inline __inline |
284d742e5611
internals: move the bitmanipulation routines into its own file
Maciej Fijalkowski <fijall@gmail.com>
parents:
diff
changeset
|
41 #endif |
284d742e5611
internals: move the bitmanipulation routines into its own file
Maciej Fijalkowski <fijall@gmail.com>
parents:
diff
changeset
|
42 |
284d742e5611
internals: move the bitmanipulation routines into its own file
Maciej Fijalkowski <fijall@gmail.com>
parents:
diff
changeset
|
43 #endif |