From 24d7615a6ef6db51301c6b57a3332907ee2ff114 Mon Sep 17 00:00:00 2001 From: cristy Date: Sat, 18 Feb 2012 22:00:17 +0000 Subject: [PATCH] --- MagickCore/MagickCore.h | 26 ++++++++++++++++++++------ MagickWand/MagickWand.h | 26 ++++++++++++++++++++------ 2 files changed, 40 insertions(+), 12 deletions(-) diff --git a/MagickCore/MagickCore.h b/MagickCore/MagickCore.h index 453139d04..751e71a9e 100644 --- a/MagickCore/MagickCore.h +++ b/MagickCore/MagickCore.h @@ -128,12 +128,26 @@ extern "C" { #endif #define MagickSignature 0xabacadabUL -#if !defined(magick_attribute) -# if !defined(__GNUC__) -# define magick_attribute(x) /* nothing */ -# else -# define magick_attribute __attribute__ -# endif +#if defined(MAGICKCORE_HAVE___ATTRIBUTE__) +# define magick_aligned(x) __attribute__((__aligned__(x))) +# define magick_attribute __attribute__ +# define magick_unused(x) magick_unused_ ## x __attribute__((__unused__)) +#else +# define magick_aligned(x) /* nothing */ +# define magick_attribute(x) /* nothing */ +# define magick_unused(x) x +#endif + +#if defined(MAGICKCORE_HAVE___ALLOC_SIZE__) +# define magick_alloc_size(x) __attribute__((__alloc_size__(x))) +# define magick_alloc_sizes(x,y) __attribute__((__alloc_size__(x,y))) +# define magick_cold __attribute__((__cold__)) +# define magick_hot __attribute__((__hot__)) +#else +# define magick_alloc_size(x) /* nothing */ +# define magick_alloc_sizes(x,y) /* nothing */ +# define magick_cold +# define magick_hot #endif #if defined(MAGICKCORE_NAMESPACE_PREFIX) diff --git a/MagickWand/MagickWand.h b/MagickWand/MagickWand.h index bfb83f0d6..bfeca5f13 100644 --- a/MagickWand/MagickWand.h +++ b/MagickWand/MagickWand.h @@ -127,12 +127,26 @@ extern "C" { #endif #define WandSignature 0xabacadabUL -#if !defined(wand_attribute) -# if !defined(__GNUC__) -# define wand_attribute(x) /* nothing */ -# else -# define wand_attribute __attribute__ -# endif +#if defined(MAGICKCORE_HAVE___ATTRIBUTE__) +# define wand_aligned(x) __attribute__((__aligned__(x))) +# define wand_attribute __attribute__ +# define wand_unused(x) wand_unused_ ## x __attribute__((__unused__)) +#else +# define wand_aligned(x) /* nothing */ +# define wand_attribute(x) /* nothing */ +# define wand_unused(x) x +#endif + +#if defined(MAGICKCORE_HAVE___ALLOC_SIZE__) +# define wand_alloc_size(x) __attribute__((__alloc_size__(x))) +# define wand_alloc_sizes(x,y) __attribute__((__alloc_size__(x,y))) +# define wand_cold __attribute__((__cold__)) +# define wand_hot __attribute__((__hot__)) +#else +# define wand_alloc_size(x) /* nothing */ +# define wand_alloc_sizes(x,y) /* nothing */ +# define wand_cold +# define wand_hot #endif typedef struct _MagickWand -- 2.40.0