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 #if defined(__clang__) 153 #define DMLC_SUPPRESS_UBSAN __attribute__((no_sanitize("undefined"))) 154 #elif defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 409) 155 #define DMLC_SUPPRESS_UBSAN __attribute__((no_sanitize_undefined)) 157 #define DMLC_SUPPRESS_UBSAN 161 #define DMLC_STR_CONCAT_(__x, __y) __x##__y 162 #define DMLC_STR_CONCAT(__x, __y) DMLC_STR_CONCAT_(__x, __y) 172 #ifndef DISALLOW_COPY_AND_ASSIGN 174 # define DISALLOW_COPY_AND_ASSIGN(T) \ 175 T(T const&) = delete; \ 177 T& operator=(T const&) = delete; \ 178 T& operator=(T&&) = delete 180 # define DISALLOW_COPY_AND_ASSIGN(T) \ 182 T& operator=(T const&) 187 # define off64_t off_t 194 #define snprintf sprintf_s 195 #define vsnprintf vsprintf_s 198 #ifdef _FILE_OFFSET_BITS 199 #if _FILE_OFFSET_BITS == 32 200 #pragma message("Warning: FILE OFFSET BITS defined to be 32 bit") 205 #include <sys/types.h> 210 typedef signed char int8_t;
212 typedef __int16 int16_t;
213 typedef __int32 int32_t;
214 typedef __int64 int64_t;
215 typedef unsigned char uint8_t;
216 typedef unsigned __int16 uint16_t;
217 typedef unsigned __int32 uint32_t;
218 typedef unsigned __int64 uint64_t;
221 #include <inttypes.h> 226 #if defined(_MSC_VER) && _MSC_VER < 1900 227 #define noexcept_true throw () 228 #define noexcept_false 229 #define noexcept(a) noexcept_##a 233 #define DMLC_THROW_EXCEPTION noexcept(false) 234 #define DMLC_NO_EXCEPTION noexcept(true) 236 #define DMLC_THROW_EXCEPTION 237 #define DMLC_NO_EXCEPTION 249 if (vec.size() == 0) {
261 inline const T *
BeginPtr(
const std::vector<T> &vec) {
262 if (vec.size() == 0) {
274 if (str.length() == 0)
return NULL;
282 inline const char*
BeginPtr(
const std::string &str) {
283 if (str.length() == 0)
return NULL;
288 #if defined(_MSC_VER) && _MSC_VER < 1900 289 #define constexpr const 290 #define alignof __alignof 297 #ifdef DMLC_CORE_USE_CMAKE 298 #include <dmlc/build_config.h> 303 #endif // DMLC_BASE_H_ T * BeginPtr(std::vector< T > &vec)
safely get the beginning address of a vector
Definition: base.h:248
namespace for dmlc
Definition: array_view.h:12
Default detection logic for fopen64 and other symbols. May be overriden by CMake. ...