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

/* Some systems don't configure 64-bit MIN/MAX by default. */
#ifndef ULLONG_MAX
#define ULLONG_MAX 0xffffffffffffffffULL
#endif
#ifndef LLONG_MAX
#define LLONG_MAX 0x7fffffffffffffffLL
#endif
#ifndef LLONG_MIN
#define LLONG_MIN (-0x7fffffffffffffffLL - 1)
#endif

/* Define O_BINARY for Posix systems */
#define O_BINARY 0

/*
 * Define WT threading and concurrency primitives
 */
typedef pthread_cond_t wt_cond_t;
typedef pthread_mutex_t wt_mutex_t;
typedef struct {
    bool created;
    pthread_t id;
} wt_thread_t;

/*
 * Thread callbacks need to match the platform specific callback types
 */
/* NOLINTNEXTLINE(misc-macro-parentheses) */
#define WT_THREAD_CALLBACK(x) void *(x)
#define WT_THREAD_RET void *
#define WT_THREAD_RET_VALUE NULL

/*
 * WT declaration for calling convention type
 */
#define WT_CDECL