STIR  6.2.0
ByteOrderDefine.h
Go to the documentation of this file.
1 //
2 //
12 /*
13  Copyright (C) 2000- 2009, Hammersmith Imanet Ltd
14  This file is part of STIR.
15 
16  SPDX-License-Identifier: Apache-2.0
17 
18  See STIR/LICENSE.txt for details
19 */
20 
21 #include "stir/common.h"
22 
23 START_NAMESPACE_STIR
24 
25 // currently checked by asserts()
26 // partially from https://stackoverflow.com/a/27054190
27 #if defined(BIG_ENDIAN_BYTE_ORDER_FROM_CMAKE) /* variable set via CMake in stir/config.h */ \
28  || (!defined(LITTLE_ENDIAN_BYTE_ORDER_FROM_CMAKE) /* variable set via CMake in stir/config.h */ \
29  && ((!defined(__alpha) && (!defined(_WIN32) || defined(_M_PPC) || defined(_M_MPPC)) && !defined(__i386__) \
30  && !defined(__i486__) && !defined(__i586__) && !defined(__i686__) && !defined(__i786__) && !defined(__i886__) \
31  && !defined(__k6__) && !defined(__athlon__) && !defined(__x86_64__) && !defined(__k6__)) \
32  || (defined(__MSL__) && !defined(__LITTLE_ENDIAN)) || (defined(__BYTE_ORDER) && __BYTE_ORDER == __BIG_ENDIAN) \
33  || (defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__) /* gcc */) || defined(__BIG_ENDIAN__)))
34 # define STIRIsNativeByteOrderBigEndian 1
35 # define STIRIsNativeByteOrderLittleEndian 0
36 #else
37 # define STIRIsNativeByteOrderBigEndian 0
38 # define STIRIsNativeByteOrderLittleEndian 1
39 #endif
40 
87 END_NAMESPACE_STIR
basic configuration include file