acl  3.5.3.0
acl_cpp_define.hpp
浏览该文件的文档.
1 #pragma once
2 
3 #ifdef ACL_CPP_LIB
4 # ifndef ACL_CPP_API
5 # define ACL_CPP_API
6 # endif
7 #elif defined(ACL_CPP_DLL) // || defined(_WINDLL)
8 # if defined(ACL_CPP_EXPORTS) || defined(acl_cpp_EXPORTS)
9 # ifndef ACL_CPP_API
10 # define ACL_CPP_API __declspec(dllexport)
11 # endif
12 # elif !defined(ACL_CPP_API)
13 # define ACL_CPP_API __declspec(dllimport)
14 # endif
15 #elif !defined(ACL_CPP_API)
16 # define ACL_CPP_API
17 #endif
18 
19 /*
20 #ifndef ACL_CPP_TPL
21 # ifdef ACL_CPP_DLL
22 # ifdef ACL_CPP_EXPORTS
23 # define ACL_CPP_TPL __declspec(dllexport)
24 # else
25 # define ACL_CPP_TPL
26 # endif
27 # else
28 # define ACL_CPP_TPL
29 # endif
30 #endif
31 */
32 
33 #include <stdlib.h>
34 #include <stdio.h>
35 #include <errno.h>
36 #include <string.h>
37 
38 #ifdef _MSC_VER
39 # pragma warning(disable:4251)
40 //# if !defined(VC2003) && !defined(VC6)
41 //extern "C" { FILE _iob[3] = {__iob_func()[0], __iob_func()[1], __iob_func()[2]}; }
42 //extern "C" { FILE _iob[3]; }
43 //# endif
44 # ifndef HAS_SSIZE_T
45 # define HAS_SSIZE_T
46 # if defined(_WIN64)
47 typedef __int64 ssize_t;
48 # elif defined(_WIN32)
49 typedef int ssize_t;
50 # else
51 typedef long ssize_t;
52 # endif
53 # endif
54 # if(_MSC_VER >= 1300)
55 # include <winsock2.h>
56 # include <mswsock.h>
57 # else
58 # include <winsock.h>
59 # endif
60 #else
61 # ifdef HAVE_MEMCACHED
62 # undef HAVE_MEMCACHED
63 # endif
64 #endif
65 
66 #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4)
67 #define ACL_CPP_PRINTF(format_idx, arg_idx) \
68  __attribute__((__format__ (__printf__, (format_idx), (arg_idx))))
69 #define ACL_CPP_SCANF(format_idx, arg_idx) \
70  __attribute__((__format__ (__scanf__, (format_idx), (arg_idx))))
71 #define ACL_CPP_NORETURN __attribute__((__noreturn__))
72 #define ACL_CPP_UNUSED __attribute__((__unused__))
73 #else
74 #define ACL_CPP_PRINTF(format_idx, arg_idx)
75 #define ACL_CPP_SCANF
76 #define ACL_CPP_NORETURN
77 #define ACL_CPP_UNUSED
78 #endif // __GNUC__
79 
80 #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)
81 #define ACL_CPP_DEPRECATED __attribute__((__deprecated__))
82 #elif defined(_MSC_VER) && (_MSC_VER >= 1300)
83 #define ACL_CPP_DEPRECATED __declspec(deprecated)
84 #else
85 #define ACL_CPP_DEPRECATED
86 #endif // __GNUC__
87 
88 #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)
89 #define ACL_CPP_DEPRECATED_FOR(f) __attribute__((deprecated("Use " #f " instead")))
90 #elif defined(_MSC_FULL_VER) && (_MSC_FULL_VER > 140050320)
91 #define ACL_CPP_DEPRECATED_FOR(f) __declspec(deprecated("is deprecated. Use '" #f "' instead"))
92 #else
93 #define ACL_CPP_DEPRECATED_FOR(f) ACL_CPP_DEPRECATED
94 #endif // __GNUC__
95 
96 #if defined(__GNUC__) && (__GNUC__ > 6 ||(__GNUC__ == 6 && __GNUC_MINOR__ >= 0))
97 # ifndef ACL_USE_CPP11
98 # define ACL_USE_CPP11
99 # endif
100 #elif defined(_MSC_VER) && (_MSC_VER >= 1900)
101 # ifndef ACL_USE_CPP11
102 # define ACL_USE_CPP11
103 # endif
104 #endif // __GNUC__
105 
106 //#define ACL_CPP_DEBUG_MEM