11 #define DMLC_USE_GLOG 0 20 #ifndef DMLC_LOG_FATAL_THROW 21 #define DMLC_LOG_FATAL_THROW 1 28 #ifndef DMLC_LOG_BEFORE_THROW 29 #define DMLC_LOG_BEFORE_THROW 0 36 #ifndef DMLC_LOG_CUSTOMIZE 37 #define DMLC_LOG_CUSTOMIZE 0 43 #ifndef DMLC_LOG_DEBUG 45 #define DMLC_LOG_DEBUG 0 47 #define DMLC_LOG_DEBUG 1 53 #define DMLC_USE_HDFS 0 67 #ifndef DMLC_USE_CXX11 68 #if defined(__GXX_EXPERIMENTAL_CXX0X__) || defined(_MSC_VER) 69 #define DMLC_USE_CXX11 1 71 #define DMLC_USE_CXX11 (__cplusplus >= 201103L) 76 #ifndef DMLC_STRICT_CXX11 78 #define DMLC_STRICT_CXX11 1 80 #define DMLC_STRICT_CXX11 (__cplusplus >= 201103L) 85 #ifndef DMLC_CXX11_THREAD_LOCAL 87 #define DMLC_CXX11_THREAD_LOCAL (_MSC_VER >= 1900) 88 #elif defined(__clang__) 89 #define DMLC_CXX11_THREAD_LOCAL (__has_feature(cxx_thread_local)) 91 #define DMLC_CXX11_THREAD_LOCAL (__cplusplus >= 201103L) 96 #ifndef DMLC_MODERN_THREAD_LOCAL 97 #define DMLC_MODERN_THREAD_LOCAL 1 103 #ifndef DMLC_ENABLE_RTTI 104 #define DMLC_ENABLE_RTTI 1 108 #ifndef DMLC_USE_FOPEN64 109 #define DMLC_USE_FOPEN64 1 113 #if DMLC_USE_CXX11 && defined(__GNUC__) && !defined(__clang_version__) 114 #if __GNUC__ == 4 && __GNUC_MINOR__ < 6 115 #pragma message("Will need g++-4.6 or higher to compile all" \ 116 "the features in dmlc-core, " \ 117 "compile without c++0x, some features may be disabled") 118 #undef DMLC_USE_CXX11 119 #define DMLC_USE_CXX11 0 127 #ifndef DMLC_IO_USE_LITTLE_ENDIAN 128 #define DMLC_IO_USE_LITTLE_ENDIAN 1 135 #ifndef DMLC_ENABLE_STD_THREAD 136 #define DMLC_ENABLE_STD_THREAD DMLC_USE_CXX11 140 #ifndef DMLC_USE_REGEX 141 #define DMLC_USE_REGEX DMLC_STRICT_CXX11 145 #if defined(__GNUC__) 146 #define DMLC_ATTRIBUTE_UNUSED __attribute__((unused)) 148 #define DMLC_ATTRIBUTE_UNUSED 152 #define DMLC_STR_CONCAT_(__x, __y) __x##__y 153 #define DMLC_STR_CONCAT(__x, __y) DMLC_STR_CONCAT_(__x, __y) 163 #ifndef DISALLOW_COPY_AND_ASSIGN 165 # define DISALLOW_COPY_AND_ASSIGN(T) \ 166 T(T const&) = delete; \ 168 T& operator=(T const&) = delete; \ 169 T& operator=(T&&) = delete 171 # define DISALLOW_COPY_AND_ASSIGN(T) \ 173 T& operator=(T const&) 178 # define off64_t off_t 185 #define snprintf sprintf_s 186 #define vsnprintf vsprintf_s 189 #ifdef _FILE_OFFSET_BITS 190 #if _FILE_OFFSET_BITS == 32 191 #pragma message("Warning: FILE OFFSET BITS defined to be 32 bit") 196 #include <sys/types.h> 201 typedef signed char int8_t;
203 typedef __int16 int16_t;
204 typedef __int32 int32_t;
205 typedef __int64 int64_t;
206 typedef unsigned char uint8_t;
207 typedef unsigned __int16 uint16_t;
208 typedef unsigned __int32 uint32_t;
209 typedef unsigned __int64 uint64_t;
212 #include <inttypes.h> 217 #if defined(_MSC_VER) && _MSC_VER < 1900 218 #define noexcept_true throw () 219 #define noexcept_false 220 #define noexcept(a) noexcept_##a 224 #define DMLC_THROW_EXCEPTION noexcept(false) 225 #define DMLC_NO_EXCEPTION noexcept(true) 227 #define DMLC_THROW_EXCEPTION 228 #define DMLC_NO_EXCEPTION 240 if (vec.size() == 0) {
252 inline const T *
BeginPtr(
const std::vector<T> &vec) {
253 if (vec.size() == 0) {
265 if (str.length() == 0)
return NULL;
273 inline const char*
BeginPtr(
const std::string &str) {
274 if (str.length() == 0)
return NULL;
279 #if defined(_MSC_VER) && _MSC_VER < 1900 280 #define constexpr const 281 #define alignof __alignof 288 #ifdef DMLC_CORE_USE_CMAKE 289 #include <dmlc/build_config.h> 294 #endif // DMLC_BASE_H_ T * BeginPtr(std::vector< T > &vec)
safely get the beginning address of a vector
Definition: base.h:239
namespace for dmlc
Definition: array_view.h:12
Default detection logic for fopen64 and other symbols. May be overriden by CMake. ...