11#define DMLC_USE_GLOG 0
33#ifndef DMLC_LOG_FATAL_THROW
34#define DMLC_LOG_FATAL_THROW 1
41#ifndef DMLC_LOG_BEFORE_THROW
42#define DMLC_LOG_BEFORE_THROW 0
49#ifndef DMLC_LOG_CUSTOMIZE
50#define DMLC_LOG_CUSTOMIZE 0
58#define DMLC_LOG_DEBUG 0
60#define DMLC_LOG_DEBUG 1
67#ifndef DMLC_LOG_NODATE
68#define DMLC_LOG_NODATE 0
73#define DMLC_USE_HDFS 0
88#if defined(__GXX_EXPERIMENTAL_CXX0X__) || defined(_MSC_VER)
89#define DMLC_USE_CXX11 1
91#define DMLC_USE_CXX11 (__cplusplus >= 201103L)
96#ifndef DMLC_STRICT_CXX11
98#define DMLC_STRICT_CXX11 1
100#define DMLC_STRICT_CXX11 (__cplusplus >= 201103L)
105#ifndef DMLC_CXX11_THREAD_LOCAL
107#define DMLC_CXX11_THREAD_LOCAL (_MSC_VER >= 1900)
108#elif defined(__clang__)
109#define DMLC_CXX11_THREAD_LOCAL (__has_feature(cxx_thread_local))
111#define DMLC_CXX11_THREAD_LOCAL (__cplusplus >= 201103L)
116#ifndef DMLC_MODERN_THREAD_LOCAL
117#define DMLC_MODERN_THREAD_LOCAL 1
123#ifndef DMLC_ENABLE_RTTI
124#define DMLC_ENABLE_RTTI 1
128#ifndef DMLC_USE_FOPEN64
129#define DMLC_USE_FOPEN64 1
134#if (!defined(_MSC_VER) && __cplusplus < 201103L) || (defined(_MSC_VER) && _MSC_VER < 1900)
138#pragma message("Compiling without c++11, some features may be disabled")
140#define DMLC_USE_CXX11 0
149#ifndef DMLC_IO_USE_LITTLE_ENDIAN
150#define DMLC_IO_USE_LITTLE_ENDIAN 1
157#ifndef DMLC_ENABLE_STD_THREAD
158#define DMLC_ENABLE_STD_THREAD DMLC_USE_CXX11
162#ifndef DMLC_USE_REGEX
163#define DMLC_USE_REGEX DMLC_STRICT_CXX11
168#define DMLC_ATTRIBUTE_UNUSED __attribute__((unused))
170#define DMLC_ATTRIBUTE_UNUSED
174#if defined(__clang__)
175#define DMLC_SUPPRESS_UBSAN __attribute__((no_sanitize("undefined")))
176#elif defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 409)
177#define DMLC_SUPPRESS_UBSAN __attribute__((no_sanitize_undefined))
179#define DMLC_SUPPRESS_UBSAN
183#define DMLC_STR_CONCAT_(__x, __y) __x##__y
184#define DMLC_STR_CONCAT(__x, __y) DMLC_STR_CONCAT_(__x, __y)
194#ifndef DISALLOW_COPY_AND_ASSIGN
196# define DISALLOW_COPY_AND_ASSIGN(T) \
197 T(T const&) = delete; \
199 T& operator=(T const&) = delete; \
200 T& operator=(T&&) = delete
202# define DISALLOW_COPY_AND_ASSIGN(T) \
204 T& operator=(T const&)
209# define off64_t off_t
216#define snprintf sprintf_s
217#define vsnprintf vsprintf_s
220#ifdef _FILE_OFFSET_BITS
221#if _FILE_OFFSET_BITS == 32
222#pragma message("Warning: FILE OFFSET BITS defined to be 32 bit")
227#include <sys/types.h>
233typedef signed char int8_t;
234typedef __int16 int16_t;
235typedef __int32 int32_t;
236typedef __int64 int64_t;
237typedef unsigned char uint8_t;
238typedef unsigned __int16 uint16_t;
239typedef unsigned __int32 uint32_t;
240typedef unsigned __int64 uint64_t;
248#if defined(_MSC_VER) && _MSC_VER < 1900
249#define noexcept_true throw ()
250#define noexcept_false
251#define noexcept(a) noexcept_##a
255#define DMLC_NO_INLINE __declspec(noinline)
257#define DMLC_NO_INLINE __attribute__((noinline))
260#if defined(__GNUC__) || defined(__clang__)
261#define DMLC_ALWAYS_INLINE inline __attribute__((__always_inline__))
262#elif defined(_MSC_VER)
263#define DMLC_ALWAYS_INLINE __forceinline
265#define DMLC_ALWAYS_INLINE inline
269#define DMLC_THROW_EXCEPTION noexcept(false)
270#define DMLC_NO_EXCEPTION noexcept(true)
272#define DMLC_THROW_EXCEPTION
273#define DMLC_NO_EXCEPTION
285 if (vec.size() == 0) {
297inline const T *
BeginPtr(
const std::vector<T> &vec) {
298 if (vec.size() == 0) {
310 if (str.length() == 0)
return NULL;
318inline const char*
BeginPtr(
const std::string &str) {
319 if (str.length() == 0)
return NULL;
324#if defined(_MSC_VER) && _MSC_VER < 1900
325#define constexpr const
326#define alignof __alignof
333#ifdef DMLC_CORE_USE_CMAKE
334#include <dmlc/build_config.h>
Default detection logic for fopen64 and other symbols. May be overriden by CMake.
namespace for dmlc
Definition array_view.h:12
T * BeginPtr(std::vector< T > &vec)
safely get the beginning address of a vector
Definition base.h:284