#ifndef ARCH_H #define ARCH_H /* * TEA Total Copyright (c) Alex Holden 2000. * * This code is public domain; you can do whatever you want with it, though I * would prefer you to contribute any bug fixes back to me if possible. * This software comes with NO WARRANTY WHATSOEVER, not even the implied * warranties of merchantability and fitness for a particular purpose. */ #if defined(ARCH_OPENBSD) || defined(ARCH_FREEBSD) #if defined(ARCH_OPENBSD) #include #include #endif #if defined(ARCH_FREEBSD) #include #endif typedef uint32_t u32; typedef int32_t s32; typedef uint16_t u16; typedef uint8_t u8; #elif defined(ARCH_LINUX) #include #define BYTE_ORDER __BYTE_ORDER #include typedef __u32 u32; typedef __s32 s32; typedef __u16 u16; typedef __u8 u8; #elif defined(ARCH_DJGPP) #define LITTLE_ENDIAN 1234 #define BYTE_ORDER LITTLE_ENDIAN typedef unsigned long u32; typedef signed long s32; typedef unsigned short u16; typedef unsigned char u8; #define DOS_LINE_ENDINGS #elif defined(ARCH_UNKNOWN_LITTLE) #define LITTLE_ENDIAN 1234 #define BYTE_ORDER LITTLE_ENDIAN typedef unsigned long u32; typedef signed long s32; typedef unsigned short u16; typedef unsigned char u8; #elif defined(ARCH_UNKNOWN_BIG) #define BIG_ENDIAN 4321 #define BYTE_ORDER BIG_ENDIAN typedef unsigned long u32; typedef signed long s32; typedef unsigned short u16; typedef unsigned char u8; #else #error Architecture not defined #endif #define LENDIAN 'L' #define BENDIAN 'B' #if BYTE_ORDER == LITTLE_ENDIAN #define HOST_BYTE_ORDER LENDIAN #elif BYTE_ORDER == BIG_ENDIAN #define HOST_BYTE_ORDER BENDIAN #else #error Unspecified or unknown byte order #endif #endif