blob: 43abc4fd5e84d0385a065c4a243c2e613b5f08df (
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
|
#ifndef EFSW_BASE
#define EFSW_BASE
#include <efsw/efsw.hpp>
#include <efsw/sophist.h>
namespace efsw {
typedef SOPHIST_int8 Int8;
typedef SOPHIST_uint8 Uint8;
typedef SOPHIST_int16 Int16;
typedef SOPHIST_uint16 Uint16;
typedef SOPHIST_int32 Int32;
typedef SOPHIST_uint32 Uint32;
typedef SOPHIST_int64 Int64;
typedef SOPHIST_uint64 Uint64;
#define EFSW_OS_WIN 1
#define EFSW_OS_LINUX 2
#define EFSW_OS_MACOSX 3
#define EFSW_OS_BSD 4
#define EFSW_OS_SOLARIS 5
#define EFSW_OS_HAIKU 6
#define EFSW_OS_ANDROID 7
#define EFSW_OS_IOS 8
#define EFSW_PLATFORM_WIN32 1
#define EFSW_PLATFORM_INOTIFY 2
#define EFSW_PLATFORM_KQUEUE 3
#define EFSW_PLATFORM_FSEVENTS 4
#define EFSW_PLATFORM_GENERIC 5
#if defined( _WIN32 )
/// Any Windows platform
#define EFSW_OS EFSW_OS_WIN
#define EFSW_PLATFORM EFSW_PLATFORM_WIN32
#if ( defined( _MSCVER ) || defined( _MSC_VER ) )
#define EFSW_COMPILER_MSVC
#endif
/// Force windows target version above or equal to Windows Server 2008 or Windows Vista
#if _WIN32_WINNT < 0x600
#undef _WIN32_WINNT
#define _WIN32_WINNT 0x600
#endif
#elif defined( __FreeBSD__ ) || defined( __OpenBSD__ ) || defined( __NetBSD__ ) || \
defined( __DragonFly__ )
#define EFSW_OS EFSW_OS_BSD
#define EFSW_PLATFORM EFSW_PLATFORM_KQUEUE
#elif defined( __APPLE_CC__ ) || defined( __APPLE__ )
#include <TargetConditionals.h>
#if defined( __IPHONE__ ) || ( defined( TARGET_OS_IPHONE ) && TARGET_OS_IPHONE ) || \
( defined( TARGET_IPHONE_SIMULATOR ) && TARGET_IPHONE_SIMULATOR )
#define EFSW_OS EFSW_OS_IOS
#define EFSW_PLATFORM EFSW_PLATFORM_KQUEUE
#else
#define EFSW_OS EFSW_OS_MACOSX
#if defined( EFSW_FSEVENTS_NOT_SUPPORTED )
#define EFSW_PLATFORM EFSW_PLATFORM_KQUEUE
#else
#define EFSW_PLATFORM EFSW_PLATFORM_FSEVENTS
#endif
#endif
#elif defined( __linux__ )
/// This includes Linux and Android
#ifndef EFSW_KQUEUE
#define EFSW_PLATFORM EFSW_PLATFORM_INOTIFY
#else
/// This is for testing libkqueue, sadly it doesnt work
#define EFSW_PLATFORM EFSW_PLATFORM_KQUEUE
#endif
#if defined( __ANDROID__ ) || defined( ANDROID )
#define EFSW_OS EFSW_OS_ANDROID
#else
#define EFSW_OS EFSW_OS_LINUX
#endif
#else
#if defined( __SVR4 )
#define EFSW_OS EFSW_OS_SOLARIS
#elif defined( __HAIKU__ ) || defined( __BEOS__ )
#define EFSW_OS EFSW_OS_HAIKU
#endif
/// Everything else
#define EFSW_PLATFORM EFSW_PLATFORM_GENERIC
#endif
#if EFSW_PLATFORM != EFSW_PLATFORM_WIN32
#define EFSW_PLATFORM_POSIX
#endif
#if 1 == SOPHIST_pointer64
#define EFSW_64BIT
#else
#define EFSW_32BIT
#endif
#if defined( arm ) || defined( __arm__ )
#define EFSW_ARM
#endif
#define efCOMMA ,
#define efSAFE_DELETE( p ) \
{ \
if ( p ) { \
delete ( p ); \
( p ) = NULL; \
} \
}
#define efSAFE_DELETE_ARRAY( p ) \
{ \
if ( p ) { \
delete[] ( p ); \
( p ) = NULL; \
} \
}
#define efARRAY_SIZE( __array ) ( sizeof( __array ) / sizeof( __array[0] ) )
} // namespace efsw
#endif
|