adchpp.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef ADCHPP_ADCHPP_H
00020 #define ADCHPP_ADCHPP_H
00021
00022
00023
00024 #ifndef _REENTRANT
00025 # define _REENTRANT 1
00026 #endif
00027
00028 #ifdef _MSC_VER
00029
00030 # define _CRT_SECURE_NO_DEPRECATE 1
00031 # define _ATL_SECURE_NO_DEPRECATE 1
00032 # define _CRT_NON_CONFORMING_SWPRINTFS 1
00033 #endif
00034
00035 #if defined(_MSC_VER) || defined(__MINGW32__)
00036 # define _LL(x) x##ll
00037 # define _ULL(x) x##ull
00038 # define I64_FMT "%I64d"
00039 #elif defined(SIZEOF_LONG) && SIZEOF_LONG == 8
00040 # define _LL(x) x##l
00041 # define _ULL(x) x##ul
00042 # define I64_FMT "%ld"
00043 #else
00044 # define _LL(x) x##ll
00045 # define _ULL(x) x##ull
00046 # define I64_FMT "%lld"
00047 #endif
00048
00049 #ifdef _WIN32
00050 #define PATH_SEPARATOR '\\'
00051 #define PATH_SEPARATOR_STR "\\"
00052 #else
00053 #define PATH_SEPARATOR '/'
00054 #define PATH_SEPARATOR_STR "/"
00055 #endif
00056
00057 #ifdef _WIN32
00058
00059 # ifndef _WIN32_WINNT
00060 # define _WIN32_WINNT 0x0501
00061 # endif
00062 # ifndef _WIN32_IE
00063 # define _WIN32_IE 0x0501
00064 # endif
00065 # ifndef WINVER
00066 # define WINVER 0x0501
00067 # endif
00068 # ifndef STRICT
00069 # define STRICT 1
00070 # endif
00071 # ifndef WIN32_LEAN_AND_MEAN
00072 # define WIN32_LEAN_AND_MEAN 1
00073 # endif
00074
00075 # define ADCHPP_VISIBLE
00076 # ifdef BUILDING_ADCHPP
00077 # define ADCHPP_DLL __declspec(dllexport)
00078 # else
00079 # define ADCHPP_DLL __declspec(dllimport)
00080 # endif // DLLEXPORT
00081
00082 #include <winsock2.h>
00083
00084 #include <windows.h>
00085 #include <tchar.h>
00086
00087 #else
00088
00089 # define ADCHPP_DLL __attribute__ ((visibility("default")))
00090 # define ADCHPP_VISIBLE __attribute__ ((visibility("default")))
00091
00092 #endif
00093
00094 #include <cerrno>
00095 #include <cstdarg>
00096 #include <cstddef>
00097 #include <cstdio>
00098 #include <cstdint>
00099 #include <cstring>
00100 #include <ctime>
00101
00102 #ifndef _WIN32
00103 #include <sys/time.h>
00104 #endif
00105
00106 #ifdef __MINGW32__
00107
00108
00109 #define _SHARED_PTR_H 1 // skip libstdc++'s bits/shared_ptr.h
00110 #include <boost/shared_ptr.hpp>
00111 #include <boost/enable_shared_from_this.hpp>
00112 #include <boost/make_shared.hpp>
00113 #define SHARED_PTR_NS boost
00114 #else
00115 #define SHARED_PTR_NS std
00116 #endif
00117
00118 #include <string>
00119 #include <vector>
00120 #include <list>
00121 #include <functional>
00122 #include <memory>
00123 #include <algorithm>
00124 #include <map>
00125 #include <unordered_map>
00126 #include <unordered_set>
00127
00128 #include <boost/noncopyable.hpp>
00129
00130 using SHARED_PTR_NS::shared_ptr;
00131 using SHARED_PTR_NS::enable_shared_from_this;
00132 using SHARED_PTR_NS::make_shared;
00133
00134 #ifdef _UNICODE
00135 # ifndef _T
00136 # define _T(s) L##s
00137 # endif
00138 #else
00139 # ifndef _T
00140 # define _T(s) s
00141 # endif
00142 #endif
00143
00144 #endif // STDINC_H