Menu

[r1401]: / advanced / lib / util / include / int.h  Maximize  Restore  History

Download this file

54 lines (45 with data), 1.1 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/* This takes the place of C99 inttypes.h, which at least some Windows
compilers don't have. (October 2007).
*/
/* PRId64 is the printf-style format specifier for a long long type, as in
long long mynumber = 5;
printf("My number is %" PRId64 ".\n", mynumber);
The LL/ULL macro is for 64 bit integer literals, like this:
long long mask= ULL(1) << 33;
*/
#ifdef _MSC_VER
# define PRId64 "I64d"
# define PRIu64 "I64u"
#ifndef int16_t
typedef short int16_t;
#endif
#ifndef uint16_t
typedef unsigned short uint16_t;
#endif
#ifndef int32_t
typedef int int32_t;
#endif
#ifndef uint32_t
typedef unsigned int uint32_t;
#endif
#ifndef int64_t
typedef __int64 int64_t;
#endif
#ifndef uint64_t
typedef unsigned __int64 uint64_t;
#endif
#ifndef uint
typedef unsigned int uint;
#endif
#ifndef uint8_t
typedef unsigned char uint8_t;
#endif
/* Older Microsoft compilers don't know the standard ll/ull suffixes */
#define LL(x) x ## i64
#define ULL(x) x ## u64
#else
/* Not Microsoft compiler */
#include <inttypes.h>
#define LL(x) x ## ll
#define ULL(x) x ## ull
#endif
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.