Ignore:
Timestamp:
Apr 23, 2008, 11:24:28 PM (15 years ago)
Author:
Sam Hocevar
Message:
  • Make Win32 a special case in cucul_types.h.in: it has intptr_t but none of the other required types.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/cucul/cucul_types.h.in

    r2308 r2312  
    3434#   include <unistd.h>
    3535
    36 /* fallback: nothing is available, we assume the platform is 32-bit and
    37  * sizeof(long) == sizeof(void *) */
    38 #else
     36/* mode 3: <windows.h> indicates Win32, only (u)intptr_t is present
     37 * FIXME: Win64 probably doesn't work that way */
     38#elif CUCUL_TYPES == 3
     39#include <windows.h>
     40
    3941typedef signed char int8_t;
    4042typedef signed short int16_t;
     
    4749typedef unsigned long long int uint64_t;
    4850
    49 typedef long int intptr_t;
    50 typedef unsigned long int uintptr_t;
    51 
    5251typedef int ssize_t;
    5352typedef unsigned int size_t;
     53
     54/* fallback: nothing is known, we assume the platform is 32-bit and
     55 * sizeof(long) == sizeof(void *). We don't typedef directly because we
     56 * have no idea what other typedefs have already been made. */
     57#else
     58typedef signed char _cucul_int8_t;
     59typedef signed short _cucul_int16_t;
     60typedef signed long int _cucul_int32_t;
     61typedef signed long long int _cucul_int64_t;
     62#   undef int8_t
     63#   define int8_t _cucul_int8_t
     64#   undef int16_t
     65#   define int16_t _cucul_int16_t
     66#   undef int32_t
     67#   define int32_t _cucul_int32_t
     68#   undef int64_t
     69#   define int64_t _cucul_int64_t
     70
     71typedef unsigned char _cucul_uint8_t;
     72typedef unsigned short _cucul_uint16_t;
     73typedef unsigned long int _cucul_uint32_t;
     74typedef unsigned long long int _cucul_uint64_t;
     75#   undef uint8_t
     76#   define uint8_t _cucul_uint8_t
     77#   undef uint16_t
     78#   define uint16_t _cucul_uint16_t
     79#   undef uint32_t
     80#   define uint32_t _cucul_uint32_t
     81#   undef uint64_t
     82#   define uint64_t _cucul_uint64_t
     83
     84typedef long int _cucul_intptr_t;
     85typedef unsigned long int _cucul_uintptr_t;
     86#   undef intptr_t
     87#   define intptr_t _cucul_intptr_t
     88#   undef uintptr_t
     89#   define uintptr_t _cucul_uintptr_t
     90
     91typedef int _cucul_ssize_t;
     92typedef unsigned int _cucul_size_t;
     93#   undef ssize_t
     94#   define ssize_t _cucul_ssize_t
     95#   undef size_t
     96#   define size_t _cucul_size_t
    5497
    5598#endif
Note: See TracChangeset for help on using the changeset viewer.