# endian_type.hpp

Go to the documentation of this file.

    00001 /* $Id: endian_type.hpp 15508 2009-02-17 02:08:53Z smatz $ */
    00002
    00005 #ifndef ENDIAN_TYPE_HPP
    00006 #define ENDIAN_TYPE_HPP
    00007
    00008 #if defined(ARM) || defined(__arm__) || defined(__alpha__)
    00009   #define OTTD_ALIGNMENT 1
    00010 #else
    00011   #define OTTD_ALIGNMENT 0
    00012 #endif
    00013
    00014 #define TTD_LITTLE_ENDIAN 0
    00015 #define TTD_BIG_ENDIAN 1
    00016
    00017 /* Windows has always LITTLE_ENDIAN */
    00018 #if defined(WIN32) || defined(__OS2__) || defined(WIN64)
    00019   #define TTD_ENDIAN TTD_LITTLE_ENDIAN
    00020 #elif !defined(TESTING)
    00021   /* Else include endian[target/host].h, which has the endian-type, autodetected by the Makefile */
    00022   #if defined(STRGEN)
    00023     #include "endian_host.h"
    00024   #else
    00025     #include "endian_target.h"
    00026   #endif
    00027 #endif /* WIN32 || __OS2__ || WIN64 */
    00028
    00029 #endif /* ENDIAN_TYPE_HPP */