Ignore:
Timestamp:
Oct 9, 2010, 11:43:25 AM (11 years ago)
Author:
Sam Hocevar
Message:

Get rid of the build time generated caca_types.h. It sucked.

File:
1 moved

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/caca/caca_types.h

    • Property svn:keywords set to Id
    r4680 r4686  
    11/*
    2  *  libcaca       Colour ASCII-Art library
    32 *  libcaca       Colour ASCII-Art library
    43 *  Copyright (c) 2008-2010 Sam Hocevar <sam@hocevar.net>
     
    1918#define __CACA_TYPES_H__
    2019
    21 #ifndef CACA_TYPES
    22 #   define CACA_TYPES @CACA_TYPES@
    23 #endif
    24 
    25 /* mode 1: standard <stdint.h> header is present, just include it */
    26 #if CACA_TYPES == 1
     20#if !defined _MSC_VER
     21    /* FIXME: we should detect platforms with <inttypes.h> and no <stdint.h> */
    2722#   include <stdint.h>
    2823#   include <unistd.h>
    29 
    30 /* mode 2: standard <inttypes.h> header is present, just include it */
    31 #elif CACA_TYPES == 2
    32 #   include <inttypes.h>
    33 #   include <unistd.h>
    34 
    35 /* mode 3: Win32, only (u)intptr_t is present */
    36 #elif CACA_TYPES == 3
    37 #include <windows.h>
    38 
    39 typedef signed char int8_t;
    40 typedef signed short int16_t;
    41 typedef signed int int32_t;
    42 typedef signed long long int int64_t;
    43 
    44 typedef unsigned char uint8_t;
    45 typedef unsigned short uint16_t;
    46 typedef unsigned int uint32_t;
    47 typedef unsigned long long int uint64_t;
    48 
    49 typedef int ssize_t;
    50 typedef unsigned int size_t;
    51 
    52 /* mode 4: Win64, only (u)intptr_t and size_t are present */
    53 #elif CACA_TYPES == 4
    54 #include <windows.h>
    55 
    56 typedef signed char int8_t;
    57 typedef signed short int16_t;
    58 typedef signed int int32_t;
    59 typedef signed long long int int64_t;
    60 
    61 typedef unsigned char uint8_t;
    62 typedef unsigned short uint16_t;
    63 typedef unsigned int uint32_t;
    64 typedef unsigned long long int uint64_t;
    65 
    66 typedef int ssize_t;
     24#else
     25#   if _MSC_VER >= 1600
     26        /* Visual Studio 2010 and later */
     27#       include <stdint.h>
     28#   else
     29#       include <windows.h>
     30#       if _MSC_VER >= 1300
     31            typedef signed __int8 int8_t;
     32            typedef signed __int16 int16_t;
     33            typedef signed __int32 int32_t;
     34            typedef signed __int64 int64_t;
     35            typedef unsigned __int8 uint8_t;
     36            typedef unsigned __int16 uint16_t;
     37            typedef unsigned __int32 uint32_t;
     38            typedef unsigned __int64 uint64_t;
     39#       else
     40            typedef signed char int8_t;
     41            typedef signed short int16_t;
     42            typedef signed int int32_t;
     43            typedef signed long long int int64_t;
     44            typedef unsigned char uint8_t;
     45            typedef unsigned short uint16_t;
     46            typedef unsigned int uint32_t;
     47            typedef unsigned long long int uint64_t;
     48#       endif
     49#       if defined _WIN64
     50            /* Win64, only (u)intptr_t and size_t are present */
     51            typedef int ssize_t;
     52#       else
     53            /* Win32, only (u)intptr_t is present */
     54            typedef int ssize_t;
     55            typedef unsigned int size_t;
     56#       endif
     57#   endif
     58#endif
    6759
    6860/* fallback: nothing is known, we assume the platform is 32-bit and
    6961 * sizeof(long) == sizeof(void *). We don't typedef directly because we
    7062 * have no idea what other typedefs have already been made. */
    71 #else
     63#if 0
    7264typedef signed char _caca_int8_t;
    7365typedef signed short _caca_int16_t;
     
    8274#   undef int64_t
    8375#   define int64_t _caca_int64_t
    84 
    8576typedef unsigned char _caca_uint8_t;
    8677typedef unsigned short _caca_uint16_t;
     
    9586#   undef uint64_t
    9687#   define uint64_t _caca_uint64_t
    97 
    9888typedef long int _caca_intptr_t;
    9989typedef unsigned long int _caca_uintptr_t;
     
    10292#   undef uintptr_t
    10393#   define uintptr_t _caca_uintptr_t
    104 
    10594typedef int _caca_ssize_t;
    10695typedef unsigned int _caca_size_t;
     
    10998#   undef size_t
    11099#   define size_t _caca_size_t
    111 
    112100#endif
    113101
    114102#endif /* __CACA_TYPES_H__ */
     103
Note: See TracChangeset for help on using the changeset viewer.