summaryrefslogtreecommitdiff
path: root/src/main/c/commonbase.h
blob: 581bf54f20d9300ecb986a0321f5d26b33988c71 (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

/* common config. Stuff like feature-test-macros for example */

#define _POSIX_C_SOURCE 200809L

#define STR_QUOT_IAHGEWIH(s) #s
#define STR_QUOT(s) STR_QUOT_IAHGEWIH(s)

#define STR_CAT(a, b) a ## b

#ifndef likely
#   define likely(a) (a)
#endif
#ifndef unlikely
#   define unlikely(a) (a)
#endif

#ifdef _WIN32
#   define WINDOOF 1
#endif


#if WINDOOF
static inline void fixBrokenStdio( void ){
    _setmode(_fileno(stdin), O_BINARY);
    _setmode(_fileno(stdout), O_BINARY);
}
#else
#   define fixBrokenStdio()
#endif