summaryrefslogtreecommitdiff
path: root/src/third_party/wiredtiger/src/include/lint.h
blob: 7c0a103a8eec94b93fec10a483442961f09d87d8 (plain)
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
56
/*-
 * Copyright (c) 2008-2014 WiredTiger, Inc.
 *	All rights reserved.
 *
 * See the file LICENSE for redistribution information.
 */

#define	WT_GCC_ATTRIBUTE(x)
#define	WT_GCC_FUNC_ATTRIBUTE(x)

#define	__WT_ATOMIC_ADD(v, val)						\
    ((v) += (val))
#define	__WT_ATOMIC_FETCH_ADD(v, val)					\
    ((v) += (val), (v))
#define	__WT_ATOMIC_CAS(v, old, new)					\
    ((v) = ((v) == (old) ? (new) : (old)), (v) == (old))
#define	__WT_ATOMIC_CAS_VAL(v, old, new)				\
    ((v) = ((v) == (old) ? (new) : (old)), (v) == (old))
#define	__WT_ATOMIC_STORE(v, val)					\
    ((v) = (val))
#define	__WT_ATOMIC_SUB(v, val)						\
    ((v) -= (val), (v))

#define	WT_ATOMIC_ADD1(v, val)		__WT_ATOMIC_ADD(v, val)
#define	WT_ATOMIC_FETCH_ADD1(v, val)	__WT_ATOMIC_FETCH_ADD(v, val)
#define	WT_ATOMIC_CAS1(v, old, new)	__WT_ATOMIC_CAS(v, old, new)
#define	WT_ATOMIC_CAS_VAL1(v, old, new)	__WT_ATOMIC_CAS_VAL(v, old, new)
#define	WT_ATOMIC_STORE1(v, val)	__WT_ATOMIC_STORE(v, val)
#define	WT_ATOMIC_SUB1(v, val)		__WT_ATOMIC_SUB(v, val)

#define	WT_ATOMIC_ADD2(v, val)		__WT_ATOMIC_ADD(v, val)
#define	WT_ATOMIC_FETCH_ADD2(v, val)	__WT_ATOMIC_FETCH_ADD(v, val)
#define	WT_ATOMIC_CAS2(v, old, new)	__WT_ATOMIC_CAS(v, old, new)
#define	WT_ATOMIC_CAS_VAL2(v, old, new)	__WT_ATOMIC_CAS_VAL(v, old, new)
#define	WT_ATOMIC_STORE2(v, val)	__WT_ATOMIC_STORE(v, val)
#define	WT_ATOMIC_SUB2(v, val)		__WT_ATOMIC_SUB(v, val)

#define	WT_ATOMIC_ADD4(v, val)		__WT_ATOMIC_ADD(v, val)
#define	WT_ATOMIC_FETCH_ADD4(v, val)	__WT_ATOMIC_FETCH_ADD(v, val)
#define	WT_ATOMIC_CAS4(v, old, new)	__WT_ATOMIC_CAS(v, old, new)
#define	WT_ATOMIC_CAS_VAL4(v, old, new)	__WT_ATOMIC_CAS_VAL(v, old, new)
#define	WT_ATOMIC_STORE4(v, val)	__WT_ATOMIC_STORE(v, val)
#define	WT_ATOMIC_SUB4(v, val)		__WT_ATOMIC_SUB(v, val)

#define	WT_ATOMIC_ADD8(v, val)		__WT_ATOMIC_ADD(v, val)
#define	WT_ATOMIC_FETCH_ADD8(v, val)	__WT_ATOMIC_FETCH_ADD(v, val)
#define	WT_ATOMIC_CAS8(v, old, new)	__WT_ATOMIC_CAS(v, old, new)
#define	WT_ATOMIC_CAS_VAL8(v, old, new)	__WT_ATOMIC_CAS_VAL(v, old, new)
#define	WT_ATOMIC_STORE8(v, val)	__WT_ATOMIC_STORE(v, val)
#define	WT_ATOMIC_SUB8(v, val)		__WT_ATOMIC_SUB(v, val)

static inline void WT_BARRIER(void) { return; }
static inline void WT_FULL_BARRIER(void) { return; }
static inline void WT_PAUSE(void) { return; }
static inline void WT_READ_BARRIER(void) { return; }
static inline void WT_WRITE_BARRIER(void) { return; }