23 #ifndef __ccxx_Common_hxx 24 #define __ccxx_Common_hxx 53 #define CCXX_VERSION 0x00000606 54 #define CCXX_VERSION_MAJOR ((uint_t)((CCXX_VERSION >> 16) & 0xFF)) 55 #define CCXX_VERSION_MINOR ((uint_t)((CCXX_VERSION >> 8) & 0xFF)) 56 #define CCXX_VERSION_MICRO ((uint_t)(CCXX_VERSION & 0xFF)) 76 #if defined(__CYGWIN__) 79 #define COMMONCPPDB_API 80 #define COMMONCPPJVM_API 81 #define COMMONCPPXML_API 83 #if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) \ 84 || defined(_WIN64) || defined(WIN64) 85 #define CCXX_OS_WINDOWS 88 #define CCXX_OS_WINDOWS_GNU 91 #if defined(COMMONCPP_EXPORTS) 92 #define COMMONCPP_API __declspec(dllexport) 93 #else // ! COMMONCPP_EXPORTS 94 #define COMMONCPP_API __declspec(dllimport) 95 #endif // COMMONCPP_EXPORTS 97 #if defined(COMMONCPPDB_EXPORTS) 98 #define COMMONCPPDB_API __declspec(dllexport) 99 #else // ! COMMONCPPDB_EXPORTS 100 #define COMMONCPPDB_API __declspec(dllimport) 101 #endif // COMMONCPPDB_EXPORTS 103 #if defined(COMMONCPPJVM_EXPORTS) 104 #define COMMONCPPJVM_API __declspec(dllexport) 105 #else // ! COMMONCPPJVM_EXPORTS 106 #define COMMONCPPJVM_API __declspec(dllimport) 107 #endif // COMMONCPPJVM_EXPORTS 109 #if defined(COMMONCPPXML_EXPORTS) 110 #define COMMONCPPXML_API __declspec(dllexport) 111 #else // ! COMMONCPPXML_EXPORTS 112 #define COMMONCPPXML_API __declspec(dllimport) 113 #endif // COMMONCPPXML_EXPORTS 116 #define CCXX_OS_POSIX 119 #define CCXX_OS_MACOSX 123 #define CCXX_OS_ANDROID 126 #define COMMONCPP_API 127 #define COMMONCPPDB_API 128 #define COMMONCPPJVM_API 129 #define COMMONCPPXML_API 133 #ifdef CCXX_OS_WINDOWS 143 #define _WIN32_WINNT 0x0500 // Windows 2000 or later ONLY 147 #define FD_SETSIZE 1024 148 #include <winsock2.h> 150 #endif // CCXX_OS_WINDOWS 162 #if defined(__GNUC__) && ((__GNUC__ > 3) \ 163 || ((__GNUC__ == 3) && (__GNUC_MINOR__ > 0))) 165 #define ___DEPRECATED(DECL) DECL __attribute__((deprecated)) 166 #define ___UNUSED __attribute__((unused)) 167 #define ___NORETURN(DECL) DECL __attribute__((noreturn)) 168 #define ___PRINTF(M, N) __attribute__((format(printf, M, N))) 170 #elif defined(_MSC_VER) && (_MSC_VER >= 1300) 172 #define ___DEPRECATED(DECL) __declspec(deprecated) DECL 174 #define ___NORETURN(DECL) __declspec(noreturn) DECL 175 #define ___PRINTF(M, N) 179 #define ___DEPRECATED(DECL) DECL 181 #define ___NORETURN(DECL) DECL 182 #define ___PRINTF(M, N) 188 #ifndef CCXX_OS_WINDOWS 189 #include <sys/types.h> 209 #ifdef CCXX_OS_WINDOWS 217 #define CCXX_INVALID_FILE_HANDLE INVALID_HANDLE_VALUE 219 #else // ! CCXX_OS_WINDOWS 229 #define CCXX_INVALID_FILE_HANDLE (-1) 231 #endif // CCXX_OS_WINDOWS 247 #define CCXX_LENGTHOF(A) \ 248 (sizeof(A) / sizeof(A[0])) 254 #define CCXX_OFFSETOF(S, F) \ 255 ((size_t)(((void *)(&(((S *)NULL)->F))) - ((void *)NULL))) 261 #define CCXX_ZERO(V) \ 262 (std::memset(&(V), 0, sizeof(V))) 266 #define __CCXX_STRINGIFY__(S) #S 272 #define CCXX_STRINGIFY(S) __CCXX_STRINGIFY__(S) 278 #define __CCXX_UNIQUE_VARNAME__(pfx, id, sfx) pfx ## _ ## id ## _ ## sfx 279 #define CCXX_UNIQUE_VARNAME(pfx, id, sfx) \ 280 __CCXX_UNIQUE_VARNAME__(pfx, id, sfx) 284 #define CCXX_STATIC_INITIALIZER \ 285 static void __ccxx_static_init__(void); \ 286 static bool __ccxx_static_init_done__ = (__ccxx_static_init__(), true); \ 287 static void __ccxx_static_init__(void) 295 #define CCXX_COPY_DECLS(CLASS) \ 296 CLASS(const CLASS &other); \ 297 CLASS& operator=(const CLASS &other); 299 #define CCXX_PIMPL_DECL(TYPE) \ 300 class TYPE ## Private; \ 301 TYPE ## Private *pimpl_; 303 #define CCXX_PIMPL(TYPE) \ 304 TYPE ## Private *pimpl = this->pimpl_; 335 #define CCXX_FWD_DECL(CLASS) \ 336 namespace ccxx { class CLASS; }; 338 #endif // __ccxx_Common_hxx Highest priority.
Definition: Common.h++:317
Lowest priority.
Definition: Common.h++:309
Big-endian (network byte order).
Definition: Common.h++:323
pid_t ProcessID
Definition: Common.h++:222
uint32_t char32_t
A UTF-32 character.
Definition: Common.h++:207
pthread_t ThreadHandle
Definition: Common.h++:223
int FileHandle
Definition: Common.h++:225
pthread_t ThreadID
Definition: Common.h++:224
pid_t ProcessHandle
Definition: Common.h++:221
Normal (default) priority.
Definition: Common.h++:313
uint16_t char16_t
A UTF-16 character.
Definition: Common.h++:201
Priority
Thread and Process priority levels.
Definition: Common.h++:307
Endianness
Byte endianness.
Definition: Common.h++:321
Definition: AllocationMap.c++:25
Low priority.
Definition: Common.h++:311
Little-endian.
Definition: Common.h++:325
High priority.
Definition: Common.h++:315