.. _program_listing_file__tmp_ws_src_ecl_lite_ecl_config_include_ecl_config_endianness.hpp: Program Listing for File endianness.hpp ======================================= |exhale_lsh| :ref:`Return to documentation for file ` (``/tmp/ws/src/ecl_lite/ecl_config/include/ecl/config/endianness.hpp``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS .. code-block:: cpp /***************************************************************************** ** Ifdefs *****************************************************************************/ #ifndef ECL_CONFIG_ENDIANNESS_HPP_ #define ECL_CONFIG_ENDIANNESS_HPP_ /***************************************************************************** ** Includes *****************************************************************************/ #include "portable_types.hpp" /***************************************************************************** ** Namespaces *****************************************************************************/ namespace ecl { inline bool is_big_endian() { union { uint32 i; char c[4]; } bint = {0x01020304}; return bint.c[0] == 1; } } // namespace ecl #endif /* ECL_CONFIG_ENDIANNESS_HPP_ */