From 370fb069901c89fbb053bee4dbe5688b8374b676 Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Mon, 24 Apr 2006 19:57:23 +0000 Subject: [PATCH] * Added "common.h", a placeholder for simple features and functions missing from some systems. --- Makefile.am | 2 +- common.h | 28 ++++++++++++++++++++++++++++ test/export.c | 5 +---- test/font.c | 5 +---- test/frames.c | 5 +---- test/gamma.c | 5 +---- test/hsv.c | 5 +---- test/text.c | 5 +---- test/transform.c | 5 +---- test/truecolor.c | 5 +---- test/unicode.c | 5 +---- 11 files changed, 38 insertions(+), 37 deletions(-) create mode 100644 common.h diff --git a/Makefile.am b/Makefile.am index 9cb04b6..ece3190 100644 --- a/Makefile.am +++ b/Makefile.am @@ -3,7 +3,7 @@ SUBDIRS = kernel cucul caca src test tools cpp doc DIST_SUBDIRS = $(SUBDIRS) autotools debian msvc -EXTRA_DIST = NOTES COPYING.GPL COPYING.LGPL bootstrap build-dos build-kernel build-win32 caca-config.in libcaca.spec +EXTRA_DIST = NOTES COPYING.GPL COPYING.LGPL bootstrap build-dos build-kernel build-win32 caca-config.in common.h libcaca.spec AUTOMAKE_OPTIONS = dist-bzip2 bin_SCRIPTS = caca-config diff --git a/common.h b/common.h new file mode 100644 index 0000000..04d7fa7 --- /dev/null +++ b/common.h @@ -0,0 +1,28 @@ +/* + * libcucul Canvas for ultrafast compositing of Unicode letters + * libcaca Colour ASCII-Art library + * Copyright (c) 2006 Sam Hocevar + * All Rights Reserved + * + * $Id$ + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the Do What The Fuck You Want To + * Public License, Version 2, as published by Sam Hocevar. See + * http://sam.zoy.org/wtfpl/COPYING for more details. + */ + +/* + * This file contains replacements for commonly found object types and + * function prototypes that are sometimes missing. + */ + +#if !defined(HAVE_INTTYPES_H) +typedef signed char int8_t; +typedef signed short int16_t; +typedef signed long int int32_t; +typedef unsigned char uint8_t; +typedef unsigned short uint16_t; +typedef unsigned long int uint32_t; +#endif + diff --git a/test/export.c b/test/export.c index 828dca5..092ba86 100644 --- a/test/export.c +++ b/test/export.c @@ -12,13 +12,10 @@ */ #include "config.h" +#include "common.h" #if defined(HAVE_INTTYPES_H) # include -#else -typedef unsigned char uint8_t; -typedef unsigned short uint16_t; -typedef unsigned int uint32_t; #endif #include diff --git a/test/font.c b/test/font.c index bf8c2d9..d28e3a6 100644 --- a/test/font.c +++ b/test/font.c @@ -12,13 +12,10 @@ */ #include "config.h" +#include "common.h" #if defined(HAVE_INTTYPES_H) # include -#else -typedef unsigned char uint8_t; -typedef unsigned short uint16_t; -typedef unsigned int uint32_t; #endif #if defined(HAVE_ENDIAN_H) diff --git a/test/frames.c b/test/frames.c index 90459d7..73fabd8 100644 --- a/test/frames.c +++ b/test/frames.c @@ -12,13 +12,10 @@ */ #include "config.h" +#include "common.h" #if defined(HAVE_INTTYPES_H) # include -#else -typedef unsigned char uint8_t; -typedef unsigned short uint16_t; -typedef unsigned int uint32_t; #endif #include diff --git a/test/gamma.c b/test/gamma.c index 7cc8432..e3743c0 100644 --- a/test/gamma.c +++ b/test/gamma.c @@ -12,13 +12,10 @@ */ #include "config.h" +#include "common.h" #if defined(HAVE_INTTYPES_H) # include -#else -typedef unsigned char uint8_t; -typedef unsigned short uint16_t; -typedef unsigned int uint32_t; #endif #if !defined(__KERNEL__) diff --git a/test/hsv.c b/test/hsv.c index 7292642..a0f348d 100644 --- a/test/hsv.c +++ b/test/hsv.c @@ -12,13 +12,10 @@ */ #include "config.h" +#include "common.h" #if defined(HAVE_INTTYPES_H) # include -#else -typedef unsigned char uint8_t; -typedef unsigned short uint16_t; -typedef unsigned int uint32_t; #endif #include diff --git a/test/text.c b/test/text.c index 0d0a7fc..f769eee 100644 --- a/test/text.c +++ b/test/text.c @@ -12,13 +12,10 @@ */ #include "config.h" +#include "common.h" #if defined(HAVE_INTTYPES_H) # include -#else -typedef unsigned char uint8_t; -typedef unsigned short uint16_t; -typedef unsigned int uint32_t; #endif #include diff --git a/test/transform.c b/test/transform.c index 783e3bf..4585e95 100644 --- a/test/transform.c +++ b/test/transform.c @@ -12,13 +12,10 @@ */ #include "config.h" +#include "common.h" #if defined(HAVE_INTTYPES_H) # include -#else -typedef unsigned char uint8_t; -typedef unsigned short uint16_t; -typedef unsigned int uint32_t; #endif #include diff --git a/test/truecolor.c b/test/truecolor.c index bd7f747..ae2af58 100644 --- a/test/truecolor.c +++ b/test/truecolor.c @@ -12,13 +12,10 @@ */ #include "config.h" +#include "common.h" #if defined(HAVE_INTTYPES_H) # include -#else -typedef unsigned char uint8_t; -typedef unsigned short uint16_t; -typedef unsigned int uint32_t; #endif #include diff --git a/test/unicode.c b/test/unicode.c index ad0ad72..159ea66 100644 --- a/test/unicode.c +++ b/test/unicode.c @@ -12,13 +12,10 @@ */ #include "config.h" +#include "common.h" #if defined(HAVE_INTTYPES_H) # include -#else -typedef unsigned char uint8_t; -typedef unsigned short uint16_t; -typedef unsigned int uint32_t; #endif #include