-
Notifications
You must be signed in to change notification settings - Fork 0
/
common.h
63 lines (51 loc) · 1.29 KB
/
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
//
// Created by macskas on 12/9/20.
//
#ifndef NSCA_COMMON_H
#define NSCA_COMMON_H
#define AUTHOR "macskas"
#include <cstring>
extern "C" {
// needed for the WORKERS_ENABLED
#include <sys/socket.h>
#include <event2/listener.h>
};
#if (__GNUC__ && __GNUC_MINOR__ && __GNUC_PATCHLEVEL__)
#define GCC_VERSION (__GNUC__ * 10000 \
+ __GNUC_MINOR__ * 100 \
+ __GNUC_PATCHLEVEL__)
#elif (__cplusplus)
#define GCC_VERSION __cplusplus
#else
#define GCC_VERSION 0
#endif
#ifdef __x86_64__
#define VERSION_ARCH "x86_64"
#else
#define VERSION_ARCH "i386"
#endif
#ifdef __DATE__
#define VERSION_DATE __DATE__
#else
#define VERSION_DATE "??? ??? ??"
#endif
#ifdef __TIMESTAMP__
#define VERSION_DATE_LONG __TIMESTAMP__
#else
#define VERSION_DATE_LONG "??? ??? ?? ??:??:?? ????"
#endif
#define VERSION_STRING "nsca/" VERSION_ARCH
#define GZIP_CHUNK_SIZE 16384
#define DBUFFER_4K_SIZE 4096
#define DBUFFER_32K_SIZE 32768
#define DMEMZERO( _aPtr, _aSize ) memset( ( _aPtr ), 0, ( _aSize ) )
#define MIN(a,b) (((a)<(b))?(a):(b))
#define MAX(a,b) (((a)>(b))?(a):(b))
#define DECRYPTION_MODE_SHARED_CRYPT_INSTANCE 1
#if defined(LEV_OPT_REUSEABLE_PORT) && defined(SO_REUSEPORT)
#define WORKERS_ENABLED 1
#endif
#ifndef LEV_OPT_REUSEABLE_PORT
#define LEV_OPT_REUSEABLE_PORT 0
#endif
#endif //NSCA_COMMON_H