forked from znort987/blockparser
-
Notifications
You must be signed in to change notification settings - Fork 1
/
common.h
36 lines (29 loc) · 880 Bytes
/
common.h
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
#ifndef __COMMON_H__
#define __COMMON_H__
#if !defined(__STDC_FORMAT_MACROS)
#define __STDC_FORMAT_MACROS 1
#endif
#include <stddef.h>
#include <stdlib.h>
#include <inttypes.h>
#if defined(__GNUC__)
#define likely(x) __builtin_expect((x), 1)
#define unlikely(x) __builtin_expect((x), 0)
#define ALWAYS_INLINE __attribute__ ((always_inline))
#else
#define likely(x) (x)
#define unlikely(x) (x)
#define ALWAYS_INLINE
#endif
#if defined(__CYGWIN__)
#define lseek64 lseek
#define NO_GOOGLE_MAP 1
#endif
#if defined(_WIN64)
#include <time.h>
#define NO_GOOGLE_MAP 1
#define strncasecmp _strnicmp
#define gmtime_r(x, y) gmtime_s(y, x)
#define asctime_r(x, y) asctime_s(y, 1024, x)
#endif
#endif // __COMMON_H__