diff --git a/include/dmlc/endian.h b/include/dmlc/endian.h new file mode 100644 index 0000000000..e6281ddeb2 --- /dev/null +++ b/include/dmlc/endian.h @@ -0,0 +1,17 @@ +/*! + * Copyright (c) 2017 by Contributors + * \file endian.h + * \brief Endian testing + */ +#ifndef DMLC_ENDIAN_H_ +#define DMLC_ENDIAN_H_ + +#if defined(__APPLE__) || defined(_WIN32) +#define DMLC_LITTLE_ENDIAN 1 +#else +#include +#define DMLC_LITTLE_ENDIAN (__BYTE_ORDER == __LITTLE_ENDIAN) +#endif + +#endif // DMLC_ENDIAN_H_ + diff --git a/test/filesys_test.cc b/test/filesys_test.cc index 98d1d175ac..06e639cd62 100644 --- a/test/filesys_test.cc +++ b/test/filesys_test.cc @@ -2,6 +2,7 @@ #include #include #include +#include #include "../src/io/filesys.h" int main(int argc, char *argv[]) {