1 /* ______ ___ ___ 2 * /\ _ \ /\_ \ /\_ \ 3 * \ \ \L\ \\//\ \ \//\ \ __ __ _ __ ___ 4 * \ \ __ \ \ \ \ \ \ \ /'__`\ /'_ `\/\`'__\/ __`\ 5 * \ \ \/\ \ \_\ \_ \_\ \_/\ __//\ \L\ \ \ \//\ \L\ \ 6 * \ \_\ \_\/\____\/\____\ \____\ \____ \ \_\\ \____/ 7 * \/_/\/_/\/____/\/____/\/____/\/___L\ \/_/ \/___/ 8 * /\____/ 9 * \_/__/ 10 * 11 * A header file to get definitions of uint*_t and int*_t. 12 * 13 * By Peter Wang. 14 * 15 * See readme.txt for copyright information. 16 */ 17 18 #ifndef __al_included_allegro5_astdint_h 19 #define __al_included_allegro5_astdint_h 20 21 /* Please only include this file from include/allegro5/internal/alconfig.h 22 * and don't add more than inttypes.h/stdint.h emulation here. Thanks. 23 */ 24 25 26 27 #if defined ALLEGRO_HAVE_INTTYPES_H 28 #include <inttypes.h> 29 #elif defined ALLEGRO_HAVE_STDINT_H 30 #include <stdint.h> 31 #elif defined ALLEGRO_I386 && defined ALLEGRO_LITTLE_ENDIAN 32 #ifndef ALLEGRO_GUESS_INTTYPES_OK 33 #warning Guessing the definitions of fixed-width integer types. 34 #endif 35 #include <limits.h> 36 37 #define int8_t signed char 38 #define uint8_t unsigned char 39 #define int16_t signed short 40 #define uint16_t unsigned short 41 #define int32_t signed int 42 #define uint32_t unsigned int 43 44 #define INT8_MIN CHAR_MIN 45 #define INT8_MAX CHAR_MAX 46 #define UINT8_MAX UCHAR_MAX 47 #define INT16_MIN SHRT_MIN 48 #define INT16_MAX SHRT_MAX 49 #define UINT16_MAX USHRT_MAX 50 #define INT32_MIN INT_MIN 51 #define INT32_MAX INT_MAX 52 #define UINT32_MAX UINT_MAX 53 54 #ifdef ALLEGRO_WINDOWS 55 56 #ifndef _INTPTR_T_DEFINED 57 #ifdef _WIN64 58 #define intptr_t __int64 59 #else 60 #define intptr_t int 61 #endif 62 #define _INTPTR_T_DEFINED 63 #endif 64 65 #ifndef _UINTPTR_T_DEFINED 66 #ifdef _WIN64 67 #define uintptr_t unsigned __int64 68 #else 69 #define uintptr_t unsigned int 70 #endif 71 #define _UINTPTR_T_DEFINED 72 #endif 73 74 #else 75 76 #define intptr_t int32_t 77 #define uintptr_t uint32_t 78 79 #endif 80 81 #else 82 #error I dunno how to get the definitions of fixed-width integer types on your platform. Please report this to your friendly Allegro developer. 83 #endif 84 85 86 87 #endif 88