diff --git a/.gitignore b/.gitignore index 182d20c..bf3079b 100644 --- a/.gitignore +++ b/.gitignore @@ -24,8 +24,6 @@ stamp-* *-stamp INSTALL caca-config -# libcaca binaries -caca/caca_types.h # caca-sharp binaries caca-sharp/*.dll caca-sharp/*.config diff --git a/caca/Makefile.am b/caca/Makefile.am index 2068082..0d704c9 100644 --- a/caca/Makefile.am +++ b/caca/Makefile.am @@ -1,8 +1,8 @@ -EXTRA_DIST = caca_types.h.in caca.pc.in \ +EXTRA_DIST = caca.pc.in \ mono9.data monobold12.data \ libcaca.vcproj libcaca.def -DISTCLEANFILES = caca_types.h caca.pc +DISTCLEANFILES = caca.pc AM_CPPFLAGS = -I$(top_srcdir) -DPLUGINDIR=\"$(plugindir)\" diff --git a/caca/caca_types.h.in b/caca/caca_types.h similarity index 60% rename from caca/caca_types.h.in rename to caca/caca_types.h index 11d34ab..7abcc17 100644 --- a/caca/caca_types.h.in +++ b/caca/caca_types.h @@ -1,5 +1,4 @@ /* - * libcaca Colour ASCII-Art library * libcaca Colour ASCII-Art library * Copyright (c) 2008-2010 Sam Hocevar * All Rights Reserved @@ -18,57 +17,50 @@ #ifndef __CACA_TYPES_H__ #define __CACA_TYPES_H__ -#ifndef CACA_TYPES -# define CACA_TYPES @CACA_TYPES@ -#endif - -/* mode 1: standard header is present, just include it */ -#if CACA_TYPES == 1 +#if !defined _MSC_VER + /* FIXME: we should detect platforms with and no */ # include # include - -/* mode 2: standard header is present, just include it */ -#elif CACA_TYPES == 2 -# include -# include - -/* mode 3: Win32, only (u)intptr_t is present */ -#elif CACA_TYPES == 3 -#include - -typedef signed char int8_t; -typedef signed short int16_t; -typedef signed int int32_t; -typedef signed long long int int64_t; - -typedef unsigned char uint8_t; -typedef unsigned short uint16_t; -typedef unsigned int uint32_t; -typedef unsigned long long int uint64_t; - -typedef int ssize_t; -typedef unsigned int size_t; - -/* mode 4: Win64, only (u)intptr_t and size_t are present */ -#elif CACA_TYPES == 4 -#include - -typedef signed char int8_t; -typedef signed short int16_t; -typedef signed int int32_t; -typedef signed long long int int64_t; - -typedef unsigned char uint8_t; -typedef unsigned short uint16_t; -typedef unsigned int uint32_t; -typedef unsigned long long int uint64_t; - -typedef int ssize_t; +#else +# if _MSC_VER >= 1600 + /* Visual Studio 2010 and later */ +# include +# else +# include +# if _MSC_VER >= 1300 + typedef signed __int8 int8_t; + typedef signed __int16 int16_t; + typedef signed __int32 int32_t; + typedef signed __int64 int64_t; + typedef unsigned __int8 uint8_t; + typedef unsigned __int16 uint16_t; + typedef unsigned __int32 uint32_t; + typedef unsigned __int64 uint64_t; +# else + typedef signed char int8_t; + typedef signed short int16_t; + typedef signed int int32_t; + typedef signed long long int int64_t; + typedef unsigned char uint8_t; + typedef unsigned short uint16_t; + typedef unsigned int uint32_t; + typedef unsigned long long int uint64_t; +# endif +# if defined _WIN64 + /* Win64, only (u)intptr_t and size_t are present */ + typedef int ssize_t; +# else + /* Win32, only (u)intptr_t is present */ + typedef int ssize_t; + typedef unsigned int size_t; +# endif +# endif +#endif /* fallback: nothing is known, we assume the platform is 32-bit and * sizeof(long) == sizeof(void *). We don't typedef directly because we * have no idea what other typedefs have already been made. */ -#else +#if 0 typedef signed char _caca_int8_t; typedef signed short _caca_int16_t; typedef signed long int _caca_int32_t; @@ -81,7 +73,6 @@ typedef signed long long int _caca_int64_t; # define int32_t _caca_int32_t # undef int64_t # define int64_t _caca_int64_t - typedef unsigned char _caca_uint8_t; typedef unsigned short _caca_uint16_t; typedef unsigned long int _caca_uint32_t; @@ -94,21 +85,19 @@ typedef unsigned long long int _caca_uint64_t; # define uint32_t _caca_uint32_t # undef uint64_t # define uint64_t _caca_uint64_t - typedef long int _caca_intptr_t; typedef unsigned long int _caca_uintptr_t; # undef intptr_t # define intptr_t _caca_intptr_t # undef uintptr_t # define uintptr_t _caca_uintptr_t - typedef int _caca_ssize_t; typedef unsigned int _caca_size_t; # undef ssize_t # define ssize_t _caca_ssize_t # undef size_t # define size_t _caca_size_t - #endif #endif /* __CACA_TYPES_H__ */ + diff --git a/caca/libcaca.vcproj b/caca/libcaca.vcproj index 0d5e4a6..3eea577 100644 --- a/caca/libcaca.vcproj +++ b/caca/libcaca.vcproj @@ -421,7 +421,7 @@ >