Artifact 6cfe11ed58d2222f39c1a6632a35289fdc03cd8c:
- File bdelta/compatibility.h — part of check-in [90f9b389c8] at 2016-06-15 22:36:36 on branch trunk — Added bdelta library stuff (user: bernd size: 624)
0000: 2f 2a 20 54 68 69 73 20 53 6f 75 72 63 65 20 43 /* This Source C 0010: 6f 64 65 20 46 6f 72 6d 20 69 73 20 73 75 62 6a ode Form is subj 0020: 65 63 74 20 74 6f 20 74 68 65 20 74 65 72 6d 73 ect to the terms 0030: 20 6f 66 20 74 68 65 20 4d 6f 7a 69 6c 6c 61 20 of the Mozilla 0040: 50 75 62 6c 69 63 0a 20 2a 20 4c 69 63 65 6e 73 Public. * Licens 0050: 65 2c 20 76 2e 20 32 2e 30 2e 20 49 66 20 61 20 e, v. 2.0. If a 0060: 63 6f 70 79 20 6f 66 20 74 68 65 20 4d 50 4c 20 copy of the MPL 0070: 77 61 73 20 6e 6f 74 20 64 69 73 74 72 69 62 75 was not distribu 0080: 74 65 64 20 77 69 74 68 20 74 68 69 73 0a 20 2a ted with this. * 0090: 20 66 69 6c 65 2c 20 59 6f 75 20 63 61 6e 20 6f file, You can o 00a0: 62 74 61 69 6e 20 6f 6e 65 20 61 74 20 68 74 74 btain one at htt 00b0: 70 3a 2f 2f 6d 6f 7a 69 6c 6c 61 2e 6f 72 67 2f p://mozilla.org/ 00c0: 4d 50 4c 2f 32 2e 30 2f 2e 20 2a 2f 0a 0a 2f 2f MPL/2.0/. */..// 00d0: 20 46 69 78 20 66 6f 72 20 4d 53 56 43 2b 2b 2c Fix for MSVC++, 00e0: 20 77 68 69 63 68 20 64 6f 65 73 6e 27 74 20 73 which doesn't s 00f0: 75 70 70 6f 72 74 20 56 61 72 69 61 62 6c 65 20 upport Variable 0100: 4c 65 6e 67 74 68 20 41 72 72 61 79 73 2e 0a 23 Length Arrays..# 0110: 69 66 64 65 66 20 5f 4d 53 43 5f 56 45 52 0a 09 ifdef _MSC_VER.. 0120: 23 69 6e 63 6c 75 64 65 20 3c 6d 61 6c 6c 6f 63 #include <malloc 0130: 2e 68 3e 0a 09 23 64 65 66 69 6e 65 20 53 54 41 .h>..#define STA 0140: 43 4b 5f 41 4c 4c 4f 43 28 6e 61 6d 65 2c 20 74 CK_ALLOC(name, t 0150: 79 70 65 2c 20 6e 75 6d 29 20 74 79 70 65 20 2a ype, num) type * 0160: 6e 61 6d 65 20 3d 20 28 74 79 70 65 20 2a 29 61 name = (type *)a 0170: 6c 6c 6f 63 61 28 73 69 7a 65 6f 66 28 74 79 70 lloca(sizeof(typ 0180: 65 29 20 2a 20 6e 75 6d 29 0a 0a 09 74 79 70 65 e) * num)...type 0190: 64 65 66 20 75 6e 73 69 67 6e 65 64 20 5f 5f 69 def unsigned __i 01a0: 6e 74 38 20 75 69 6e 74 38 5f 74 3b 0a 09 74 79 nt8 uint8_t;..ty 01b0: 70 65 64 65 66 20 75 6e 73 69 67 6e 65 64 20 5f pedef unsigned _ 01c0: 5f 69 6e 74 31 36 20 75 69 6e 74 31 36 5f 74 3b _int16 uint16_t; 01d0: 0a 09 74 79 70 65 64 65 66 20 75 6e 73 69 67 6e ..typedef unsign 01e0: 65 64 20 5f 5f 69 6e 74 33 32 20 75 69 6e 74 33 ed __int32 uint3 01f0: 32 5f 74 3b 0a 09 74 79 70 65 64 65 66 20 75 6e 2_t;..typedef un 0200: 73 69 67 6e 65 64 20 5f 5f 69 6e 74 36 34 20 75 signed __int64 u 0210: 69 6e 74 36 34 5f 74 3b 0a 23 65 6c 73 65 0a 09 int64_t;.#else.. 0220: 23 69 6e 63 6c 75 64 65 20 3c 73 74 64 69 6e 74 #include <stdint 0230: 2e 68 3e 0a 09 23 64 65 66 69 6e 65 20 53 54 41 .h>..#define STA 0240: 43 4b 5f 41 4c 4c 4f 43 28 6e 61 6d 65 2c 20 74 CK_ALLOC(name, t 0250: 79 70 65 2c 20 6e 75 6d 29 20 74 79 70 65 20 6e ype, num) type n 0260: 61 6d 65 5b 6e 75 6d 5d 0a 23 65 6e 64 69 66 0a ame[num].#endif.