source: libcaca/trunk/cucul/cucul_types.h.in @ 2299

Last change on this file since 2299 was 2299, checked in by Sam Hocevar, 12 years ago
  • Remove #include <stdint.h> etc. from "common.h". Instead, make sure that <cucul.h> will provide the C99 types, even if libcaca has been installed.
  • Rename what's left of "common.h" to "stubs.h".
  • Remove all references to erroneous <inttypes.h> from source files.
File size: 1.3 KB
Line 
1/*
2 *  libcucul      Canvas for ultrafast compositing of Unicode letters
3 *  libcaca       Colour ASCII-Art library
4 *  Copyright (c) 2008 Sam Hocevar <sam@zoy.org>
5 *                All Rights Reserved
6 *
7 *  $Id$
8 *
9 *  This library is free software; you can redistribute it and/or
10 *  modify it under the terms of the Do What The Fuck You Want To
11 *  Public License, Version 2, as published by Sam Hocevar. See
12 *  http://sam.zoy.org/wtfpl/COPYING for more details.
13 */
14
15/*
16 *  This file contains definitions for the C99 integer types.
17 */
18
19#ifndef __CUCUL_TYPES_H__
20#define __CUCUL_TYPES_H__
21
22#ifndef CUCUL_TYPES
23#   define CUCUL_TYPES @CUCUL_TYPES@
24#endif
25
26/* mode 1: standard <inttypes.h> header is present, just include it */
27#if CUCUL_TYPES == 1
28#   include <inttypes.h>
29
30/* mode 2: standard <stdint.h> header is present, just include it */
31#elif CUCUL_TYPES == 2
32#   include <stdint.h>
33
34/* fallback: nothing is available, we assume the platform is 32-bit and
35 * sizeof(long) == sizeof(void *) */
36#else
37typedef signed char int8_t;
38typedef signed short int16_t;
39typedef signed long int int32_t;
40
41typedef unsigned char uint8_t;
42typedef unsigned short uint16_t;
43typedef unsigned long int uint32_t;
44
45typedef long int intptr_t;
46typedef unsigned long int uintptr_t;
47
48#endif
49
50#endif /* __CUCUL_TYPES_H__ */
51
Note: See TracBrowser for help on using the repository browser.