endianness.hpp
Go to the documentation of this file.
00001 
00008 /*****************************************************************************
00009 ** Ifdefs
00010 *****************************************************************************/
00011 
00012 #ifndef ECL_CONFIG_ENDIANNESS_HPP_
00013 #define ECL_CONFIG_ENDIANNESS_HPP_
00014 
00015 /*****************************************************************************
00016 ** Includes
00017 *****************************************************************************/
00018 
00019 #include "portable_types.hpp"
00020 
00021 /*****************************************************************************
00022 ** Namespaces
00023 *****************************************************************************/
00024 
00025 namespace ecl {
00038         inline bool is_big_endian() {
00039             union {
00040                 uint32 i;
00041                 char c[4];
00042             } bint = {0x01020304};
00043 
00044             return bint.c[0] == 1;
00045         }
00046 
00047 } // namespace ecl
00048 
00049 #endif /* ECL_CONFIG_ENDIANNESS_HPP_ */


ecl_config
Author(s): Daniel Stonier
autogenerated on Sun Oct 5 2014 23:35:24