versadac
1
versadac - Scalable Recorder Firmware
Main Page
Classes
Files
File List
File Members
core
libjson
_internal
Source
JSONDefs
GNU_C.h
1
#ifndef JSON_GNU_C_HEADER
2
#define JSON_GUN_C_HEADER
3
4
#ifdef __GNUC__
5
6
#define json_deprecated(method, warning) method __attribute__((deprecated))
7
8
#if (__GNUC__ >= 3)
9
#define JSON_GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
10
#else
11
#define JSON_GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100)
12
#endif
13
14
#if (JSON_GCC_VERSION >= 40300)
15
#define json_hot __attribute__ ((hot))
16
#define json_cold __attribute__ ((cold))
17
#define json_pure json_nothrow __attribute__ ((pure, hot))
18
#define json_malloc_attr json_nothrow __attribute__ ((malloc, hot))
19
20
/* Can do priorities */
21
#if (JSON_WRITE_PRIORITY == HIGH)
22
#define json_write_priority __attribute__ ((hot))
23
#elif (JSON_WRITE_PRIORITY == LOW)
24
#define json_write_priority __attribute__ ((cold))
25
#else
26
#define json_write_priority
27
#endif
28
29
#if (JSON_READ_PRIORITY == HIGH)
30
#define json_read_priority __attribute__ ((hot))
31
#elif (JSON_READ_PRIORITY == LOW)
32
#define json_read_priority __attribute__ ((cold))
33
#else
34
#define json_read_priority
35
#endif
36
37
#define json_likely(x) __builtin_expect((long)((bool)(x)),1)
38
#define json_unlikely(x) __builtin_expect((long)((bool)(x)),0)
39
#else
40
#if (JSON_GCC_VERSION >= 29600)
41
#define json_pure json_nothrow __attribute__ ((pure))
42
#define json_likely(x) __builtin_expect((long)((bool)(x)),1)
43
#define json_unlikely(x) __builtin_expect((long)((bool)(x)),0)
44
#else
45
#define json_pure json_nothrow
46
#define json_likely(x) x
47
#define json_unlikely(x) x
48
#endif
49
50
#define json_malloc_attr json_nothrow __attribute__ ((malloc))
51
#define json_write_priority
52
#define json_read_priority
53
#define json_hot
54
#define json_cold
55
#endif
56
57
#define json_nothrow throw()
58
#define json_throws(x) throw(x)
59
60
#ifdef JSON_LESS_MEMORY
61
#define PACKED(x) :x __attribute__ ((packed))
62
#define BITS(x) :x
63
#endif
64
65
#endif
66
67
#endif
Generated on Wed Aug 19 2020 10:33:42 for versadac by
1.8.9.1