File: bits.h

package info (click to toggle)
links2 2.29-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 27,852 kB
  • sloc: ansic: 181,859; sh: 2,585; cpp: 1,450; makefile: 84; awk: 49; perl: 34
file content (55 lines) | stat: -rw-r--r-- 1,573 bytes parent folder | download | duplicates (4)
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
53
54
55
/* bits.h
 * (c) 2002 Karel 'Clock' Kulhavy
 * This file is a part of the Links program, released under GPL.
 */

/* t2c
 * Type that has exactly 2 chars.
 * If there is none, t2c is not defined
 * The type may be signed or unsigned, it doesn't matter
 */
#if SIZEOF_UNSIGNED_SHORT == 2
#define t2c unsigned short
#elif SIZEOF_UNSIGNED == 2
#define t2c unsigned
#elif SIZEOF_UNSIGNED_LONG == 2
#define t2c unsigned long
#elif defined(SIZEOF_UNSIGNED_LONG_LONG) && SIZEOF_UNSIGNED_LONG_LONG == 2
#define t2c unsigned long long
#endif /* #if sizeof(short) */

/* t4c
 * Type that has exactly 4 chars.
 * If there is none, t4c is not defined
 * The type may be signed or unsigned, it doesn't matter
 */
#if SIZEOF_UNSIGNED_SHORT == 4
#define t4c unsigned short
#elif SIZEOF_UNSIGNED == 4
#define t4c unsigned
#elif SIZEOF_UNSIGNED_LONG == 4
#define t4c unsigned long
#elif defined(SIZEOF_UNSIGNED_LONG_LONG) && SIZEOF_UNSIGNED_LONG_LONG == 4
#define t4c unsigned long long
#endif /* #if sizeof(short) */

/* t8c
 * Type that has exactly 8 chars.
 * If there is none, t8c is not defined
 * The type may be signed or unsigned, it doesn't matter
 */
#if SIZEOF_UNSIGNED_SHORT == 8
#define t8c unsigned short
#elif SIZEOF_UNSIGNED == 8
#define t8c unsigned
#elif SIZEOF_UNSIGNED_LONG == 8
#define t8c unsigned long
#elif defined(SIZEOF_UNSIGNED_LONG_LONG) && SIZEOF_UNSIGNED_LONG_LONG == 8
#define t8c unsigned long long
#endif /* #if sizeof(short) */

#ifdef t8c
#if SIZEOF_UNSIGNED_LONG >= 8 || defined(__x86_64__) || defined(__aarch64__)
#define t8c_is_efficient
#endif
#endif