Skip to content

Commit

Permalink
[ENDIAN] Endian testing (#253)
Browse files Browse the repository at this point in the history
  • Loading branch information
tqchen authored May 17, 2017
1 parent e6e9e80 commit d100d0f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
17 changes: 17 additions & 0 deletions include/dmlc/endian.h
Original file line number Diff line number Diff line change
@@ -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 <endian.h>
#define DMLC_LITTLE_ENDIAN (__BYTE_ORDER == __LITTLE_ENDIAN)
#endif

#endif // DMLC_ENDIAN_H_

1 change: 1 addition & 0 deletions test/filesys_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include <cstdlib>
#include <dmlc/logging.h>
#include <dmlc/io.h>
#include <dmlc/endian.h>
#include "../src/io/filesys.h"

int main(int argc, char *argv[]) {
Expand Down

0 comments on commit d100d0f

Please sign in to comment.