]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Sat, 18 Feb 2012 20:26:28 +0000 (20:26 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Sat, 18 Feb 2012 20:26:28 +0000 (20:26 +0000)
21 files changed:
MagickCore/MagickCore.h
MagickCore/exception.h
MagickCore/locale-private.h
MagickCore/locale_.h
MagickCore/log.h
MagickCore/magick-config.h
MagickCore/memory_.h
MagickCore/option.c
MagickCore/property.h
MagickCore/string_.h
MagickCore/studio.h
MagickCore/version.h
MagickWand/MagickWand.h
MagickWand/studio.h
Makefile.in
config/config.h.in
config/configure.xml
configure
configure.ac
m4/ax_c___alloc_size__.m4 [new file with mode: 0644]
m4/ax_c___attribute__.m4

index e47eec73420e7ece9bd08afbc8b93f9395b6851f..453139d04fd3a03fad7b34adc759ea5712cdd903 100644 (file)
@@ -66,7 +66,7 @@ extern "C" {
 #  endif
 #  if !defined(_MAGICKLIB_)
 #   if defined(__GNUC__)
-#    define MagickExport __attribute__ ((dllimport))
+#    define MagickExport __attribute__ ((__dllimport__))
 #   else
 #    define MagickExport __declspec(dllimport)
 #   endif
@@ -75,7 +75,7 @@ extern "C" {
 #   endif
 #  else
 #   if defined(__GNUC__)
-#    define MagickExport __attribute__ ((dllexport))
+#    define MagickExport __attribute__ ((__dllexport__))
 #   else
 #    define MagickExport __declspec(dllexport)
 #   endif
@@ -113,8 +113,8 @@ extern "C" {
 # endif
 #else
 # if __GNUC__ >= 4
-#  define MagickExport __attribute__ ((visibility ("default")))
-#  define MagickPrivate  __attribute__ ((visibility ("hidden")))
+#  define MagickExport __attribute__ ((__visibility__ ("default")))
+#  define MagickPrivate  __attribute__ ((__visibility__ ("hidden")))
 # else
 #   define MagickExport
 #   define MagickPrivate
index b6f718a75bf89d0f571e8c143c9857c5754b22cc..f6558f336474738d09cbe7245ae327d8e628da6b 100644 (file)
@@ -155,7 +155,7 @@ extern MagickExport MagickBooleanType
     const char *),
   ThrowMagickException(ExceptionInfo *,const char *,const char *,const size_t,
     const ExceptionType,const char *,const char *,...)
-    magick_attribute((format (printf,7,8)));
+    magick_attribute((__format__ (__printf__,7,8)));
 
 extern MagickExport void
   CatchException(ExceptionInfo *),
index 3c8fb40af355f89c977e032eb006e278a5020a55..61981ba8dd20cc4b0977672e78ff9f0d834baba8 100644 (file)
@@ -30,9 +30,9 @@ extern MagickPrivate void
 
 extern MagickPrivate ssize_t
   FormatLocaleFileList(FILE *,const char *restrict,va_list)
-    magick_attribute((format (printf,2,0))),
+    magick_attribute((__format__ (__printf__,2,0))),
   FormatLocaleStringList(char *restrict,const size_t,const char *restrict,
-    va_list) magick_attribute((format (printf,3,0)));
+    va_list) magick_attribute((__format__ (__printf__,3,0)));
 
 #if defined(__cplusplus) || defined(c_plusplus)
 }
index 3b98b7f4b4bb387d947b513961a478064a891213..930e2bd143d2aa71804b4d423b99b0d201b171d0 100644 (file)
@@ -60,9 +60,9 @@ extern MagickExport MagickBooleanType
 
 extern MagickExport ssize_t
   FormatLocaleFile(FILE *,const char *restrict,...)
-    magick_attribute((format (printf,2,3))),
+    magick_attribute((__format__ (__printf__,2,3))),
   FormatLocaleString(char *restrict,const size_t,const char *restrict,...)
-    magick_attribute((format (printf,3,4)));
+    magick_attribute((__format__ (__printf__,3,4)));
 
 #if defined(__cplusplus) || defined(c_plusplus)
 }
index a99ef2a8cb718ab6d0b3e1c81a7bd56c5a7fff74..b32f9970574c2ad7cd52e058197f214da9acdbed 100644 (file)
@@ -79,9 +79,9 @@ extern MagickExport MagickBooleanType
   ListLogInfo(FILE *,ExceptionInfo *),
   LogMagickEvent(const LogEventType,const char *,const char *,const size_t,
     const char *,...) 
-    magick_attribute((format (printf,5,6))),
+    magick_attribute((__format__ (__printf__,5,6))),
   LogMagickEventList(const LogEventType,const char *,const char *,const size_t,
-    const char *,va_list) magick_attribute((format (printf,5,0)));
+    const char *,va_list) magick_attribute((__format__ (__printf__,5,0)));
 
 extern MagickExport void
   CloseMagickLog(void),
index 6c325993c9a825b5159c2eef19e656e44d28648c..5a7a00235e4c053e209dbd9a6e30574ffc236daf 100644 (file)
 /* Define to 1 if you have the `_wstat' function. */
 /* #undef HAVE__WSTAT */
 
+/* define if your compiler has __alloc_size__ */
+#ifndef MAGICKCORE_HAVE___ALLOC_SIZE__
+#define MAGICKCORE_HAVE___ALLOC_SIZE__ 1
+#endif
+
 /* define if your compiler has __attribute__ */
 #ifndef MAGICKCORE_HAVE___ATTRIBUTE__
 #define MAGICKCORE_HAVE___ATTRIBUTE__ 1
index 56f72709743803f53c1945a63e92a8a119dbdad0..6e4620a489036783cafcb505faf81e5015002192 100644 (file)
@@ -23,25 +23,29 @@ extern "C" {
 #endif
 
 typedef void
-  *(*AcquireMemoryHandler)(size_t),
+  *(*AcquireMemoryHandler)(size_t) magick_alloc_size(1),
   (*DestroyMemoryHandler)(void *),
-  *(*ResizeMemoryHandler)(void *,size_t);
+  *(*ResizeMemoryHandler)(void *,size_t) magick_alloc_size(2);
 
 extern MagickExport void
-  *AcquireAlignedMemory(const size_t,const size_t) magick_attribute((malloc)),
-  *AcquireMagickMemory(const size_t) magick_attribute((malloc)),
-  *AcquireQuantumMemory(const size_t,const size_t) magick_attribute((malloc)),
+  *AcquireAlignedMemory(const size_t,const size_t)
+    magick_attribute((__malloc__)) magick_alloc_sizes(1,2),
+  *AcquireMagickMemory(const size_t) magick_attribute((__malloc__))
+    magick_alloc_size(1),
+  *AcquireQuantumMemory(const size_t,const size_t)
+    magick_attribute((__malloc__)) magick_alloc_sizes(1,2),
   *CopyMagickMemory(void *,const void *,const size_t)
-    magick_attribute((nonnull)),
+    magick_attribute((__nonnull__)),
   DestroyMagickMemory(void),
   GetMagickMemoryMethods(AcquireMemoryHandler *,ResizeMemoryHandler *,
     DestroyMemoryHandler *),
   *RelinquishAlignedMemory(void *),
   *RelinquishMagickMemory(void *),
   *ResetMagickMemory(void *,int,const size_t),
-  *ResizeMagickMemory(void *,const size_t) magick_attribute((malloc)),
+  *ResizeMagickMemory(void *,const size_t)
+    magick_attribute((__malloc__)) magick_alloc_size(2),
   *ResizeQuantumMemory(void *,const size_t,const size_t)
-    magick_attribute((malloc)),
+    magick_attribute((__malloc__)) magick_alloc_sizes(2,3),
   SetMagickMemoryMethods(AcquireMemoryHandler,ResizeMemoryHandler,
     DestroyMemoryHandler);
 
index ff8a1ede7d540025fef552aa4c4fd027496db6d8..253f1a81b6f7cbb75c12262c08e4ccd834dcfbf6 100644 (file)
@@ -2013,7 +2013,7 @@ MagickExport const OptionInfo *GetCommandOptionInfo(const char *value)
   static ssize_t
     table_size = 0;
 
-  register ssize_t
+  register unsigned int
     i,l,h;
 
   assert(value != (char *) NULL);
@@ -2042,9 +2042,9 @@ MagickExport const OptionInfo *GetCommandOptionInfo(const char *value)
     if ( cmp == 0 )
       cmp = *value - *(option_info[i].mnemonic);
 
-fprintf(stderr, "%d --- %u < %u < %u --- \"%s\" < \"%s\" < \"%s\"\n",
-  cmp, l,i,h,
-  option_info[l].mnemonic, option_info[i].mnemonic, option_info[h].mnemonic);
+    (void) fprintf(stderr,"%d --- %u < %u < %u --- \"%s\" < \"%s\" < \"%s\"\n",
+      cmp,l,i,h,option_info[l].mnemonic,option_info[i].mnemonic,
+      option_info[h].mnemonic);
 
     if (cmp == 0)
       return(&option_info[i]);
index 9b520da38045cf83cf529484d8f0728e27e97d82..4b24cc355ad4668bdf25de958524b884e092f3c1 100644 (file)
@@ -37,7 +37,7 @@ extern MagickExport MagickBooleanType
   DefineImageProperty(Image *,const char *,ExceptionInfo *),
   DeleteImageProperty(Image *,const char *),
   FormatImageProperty(Image *,const char *,const char *,...)
-    magick_attribute((format (printf,3,4))),
+    magick_attribute((__format__ (__printf__,3,4))),
   SetImageProperty(Image *,const char *,const char *,ExceptionInfo *);
 
 extern MagickExport void
index 436a573118dd429a1b94af17f4092b278d8e9810..5a2050cb47405b3a12135953f366046c11d92008 100644 (file)
@@ -71,9 +71,9 @@ extern MagickExport MagickBooleanType
 
 extern MagickExport size_t
   ConcatenateMagickString(char *,const char *,const size_t)
-    magick_attribute((nonnull)),
+    magick_attribute((__nonnull__)),
   CopyMagickString(char *,const char *,const size_t)
-    magick_attribute((nonnull)),
+    magick_attribute((__nonnull__)),
   GetStringInfoLength(const StringInfo *);
 
 extern MagickExport ssize_t
@@ -95,7 +95,7 @@ extern MagickExport unsigned char
 
 extern MagickExport void
   ConcatenateStringInfo(StringInfo *,const StringInfo *)
-    magick_attribute((nonnull)),
+    magick_attribute((__nonnull__)),
   LocaleLower(char *),
   LocaleUpper(char *),
   PrintStringInfo(FILE *file,const char *,const StringInfo *),
index c05e66c256b39bb1d59f4b5fca98060239160c5e..73622e9f92c0b96570b4fe8859b945236fd9ddec 100644 (file)
@@ -81,7 +81,7 @@ extern "C" {
 #  endif
 #  if !defined(_MAGICKLIB_)
 #   if defined(__GNUC__)
-#    define MagickExport __attribute__ ((dllimport))
+#    define MagickExport __attribute__ ((__dllimport__))
 #   else
 #    define MagickExport __declspec(dllimport)
 #   endif
@@ -90,7 +90,7 @@ extern "C" {
 #   endif
 #  else
 #   if defined(__GNUC__)
-#    define MagickExport __attribute__ ((dllexport))
+#    define MagickExport __attribute__ ((__dllexport__))
 #   else
 #    define MagickExport __declspec(dllexport)
 #   endif
@@ -107,7 +107,7 @@ extern "C" {
 
 # if defined(_DLL) && !defined(_LIB)
 #   if defined(__GNUC__)
-#    define ModuleExport __attribute__ ((dllexport))
+#    define ModuleExport __attribute__ ((__dllexport__))
 #   else
 #    define ModuleExport __declspec(dllexport)
 #   endif
@@ -133,8 +133,8 @@ extern "C" {
 # endif
 #else
 # if __GNUC__ >= 4
-#  define MagickExport __attribute__ ((visibility ("default")))
-#  define MagickPrivate  __attribute__ ((visibility ("hidden")))
+#  define MagickExport __attribute__ ((__visibility__ ("default")))
+#  define MagickPrivate  __attribute__ ((__visibility__ ("hidden")))
 # else
 #   define MagickExport
 #   define MagickPrivate
@@ -247,15 +247,27 @@ extern int vsnprintf(char *,size_t,const char *,va_list);
 #endif
 
 #if defined(MAGICKCORE_HAVE___ATTRIBUTE__)
-#  define magick_aligned(x)  __attribute__((aligned(x)))
+#  define magick_aligned(x)  __attribute__((__aligned__(x)))
 #  define magick_attribute  __attribute__
-#  define magick_unused(x)  magick_unused_ ## x __attribute__((unused))
+#  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___ATTRIBUTE__)
+#  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)  /* nothing */
+#  define magick_cold
+#  define magick_hot
+#endif
+
 #if defined(MAGICKCORE_WINDOWS_SUPPORT) || defined(MAGICKCORE_POSIX_SUPPORT)
 # include <sys/types.h>
 # include <sys/stat.h>
index 157b8eb9f9069fb5b916c0f1ba0328b8fba89f4e..cd4f609e112e27d1f12574626f0468b44de4ad5f 100644 (file)
@@ -27,14 +27,14 @@ extern "C" {
 */
 #define MagickPackageName "ImageMagick"
 #define MagickCopyright  "Copyright (C) 1999-2012 ImageMagick Studio LLC"
-#define MagickSVNRevision  "6837"
+#define MagickSVNRevision  "6876"
 #define MagickLibVersion  0x700
 #define MagickLibVersionText  "7.0.0"
 #define MagickLibVersionNumber  7,0,0
 #define MagickLibAddendum  "-0"
 #define MagickLibInterface  7
 #define MagickLibMinInterface  7
-#define MagickReleaseDate  "2012-02-12"
+#define MagickReleaseDate  "2012-02-18"
 #define MagickChangeDate   "20110801"
 #define MagickAuthoritativeURL  "http://www.imagemagick.org"
 #if defined(MAGICKCORE_OPENMP_SUPPORT)
index 3bb5a28ace02b4db04b263cea8cf612a351e96a4..bfb83f0d6223a1627084bb763bb6a4da5d4df189 100644 (file)
@@ -66,7 +66,7 @@ extern "C" {
 #  endif
 #  if !defined(_MAGICKLIB_)
 #   if defined(__GNUC__)
-#    define WandExport __attribute__ ((dllimport))
+#    define WandExport __attribute__ ((__dllimport__))
 #   else
 #    define WandExport __declspec(dllimport)
 #   endif
@@ -75,7 +75,7 @@ extern "C" {
 #   endif
 #  else
 #   if defined(__GNUC__)
-#    define WandExport __attribute__ ((dllexport))
+#    define WandExport __attribute__ ((__dllexport__))
 #   else
 #    define WandExport __declspec(dllexport)
 #   endif
@@ -113,8 +113,8 @@ extern "C" {
 # endif
 #else
 # if __GNUC__ >= 4
-#  define WandExport __attribute__ ((visibility ("default")))
-#  define WandPrivate  __attribute__ ((visibility ("hidden")))
+#  define WandExport __attribute__ ((__visibility__ ("default")))
+#  define WandPrivate  __attribute__ ((__visibility__ ("hidden")))
 # else
 #   define WandExport
 #   define WandPrivate
index 3dafb928f5644a297eb3839af95d01bef52f64e9..f73c8fdfef6466368e775598e26030147beb5d44 100644 (file)
@@ -75,7 +75,7 @@ extern "C" {
 #  endif
 #  if !defined(_MAGICKLIB_)
 #   if defined(__GNUC__)
-#    define WandExport __attribute__ ((dllimport))
+#    define WandExport __attribute__ ((__dllimport__))
 #   else
 #    define WandExport __declspec(dllimport)
 #   endif
@@ -84,7 +84,7 @@ extern "C" {
 #   endif
 #  else
 #   if defined(__GNUC__)
-#    define WandExport __attribute__ ((dllexport))
+#    define WandExport __attribute__ ((__dllexport__))
 #   else
 #    define WandExport __declspec(dllexport)
 #   endif
@@ -123,8 +123,8 @@ extern "C" {
 # endif
 #else
 # if __GNUC__ >= 4
-#  define WandExport __attribute__ ((visibility ("default")))
-#  define WandPrivate  __attribute__ ((visibility ("hidden")))
+#  define WandExport __attribute__ ((__visibility__ ("default")))
+#  define WandPrivate  __attribute__ ((__visibility__ ("hidden")))
 # else
 #   define WandExport
 #   define WandPrivate
@@ -252,15 +252,27 @@ extern int vsnprintf(char *,size_t,const char *,va_list);
 #endif
 
 #if defined(MAGICKCORE_HAVE___ATTRIBUTE__)
-#  define wand_aligned(x)  __attribute__((aligned(x)))
+#  define wand_aligned(x)  __attribute__((__aligned__(x)))
 #  define wand_attribute  __attribute__
-#  define wand_unused(x)  wand_unused_ ## x __attribute__((unused))
+#  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___ATTRIBUTE__)
+#  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)  /* nothing */
+#  define wand_cold
+#  define wand_hot
+#endif
+
 #if defined(MAGICKCORE_WINDOWS_SUPPORT) || defined(MAGICKCORE_POSIX_SUPPORT)
 # include <sys/types.h>
 # include <sys/stat.h>
index 801ad63a13f983a2b3c112ee823ba319ae2b93fc..eae8c8e4dcb5bd5b8b620bbf06102d7329774470 100644 (file)
@@ -275,6 +275,7 @@ subdir = .
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_func_fseeko.m4 \
        $(top_srcdir)/m4/argz.m4 \
+       $(top_srcdir)/m4/ax_c___alloc_size__.m4 \
        $(top_srcdir)/m4/ax_c___attribute__.m4 \
        $(top_srcdir)/m4/ax_cflags_warn_all.m4 \
        $(top_srcdir)/m4/ax_compare_version.m4 \
index 8e56fca1e1cd3425f8d6bfa893daae4c083b030d..24a6f1a61e3e5aef701bab61666e840b2b383789 100644 (file)
 /* Define to 1 if you have the `_wstat' function. */
 #undef HAVE__WSTAT
 
+/* define if your compiler has __alloc_size__ */
+#undef HAVE___ALLOC_SIZE__
+
 /* define if your compiler has __attribute__ */
 #undef HAVE___ATTRIBUTE__
 
index 4445825dd552a14a4e39b7721770ff6a087748da..ccdd6bd326120fda3b598a70b7cd9b3f9d34886f 100644 (file)
@@ -10,8 +10,8 @@
   <configure name="VERSION" value="7.0.0"/>
   <configure name="LIB_VERSION" value="0x700"/>
   <configure name="LIB_VERSION_NUMBER" value="7,0,0,0"/>
-  <configure name="SVN_REVISION" value="6837" />
-  <configure name="RELEASE_DATE" value="2012-02-12"/>
+  <configure name="SVN_REVISION" value="6876" />
+  <configure name="RELEASE_DATE" value="2012-02-18"/>
   <configure name="CONFIGURE" value="./configure "/>
   <configure name="PREFIX" value="/usr/local"/>
   <configure name="EXEC-PREFIX" value="/usr/local"/>
index 64252b6b27e423f511dc155aed0dde294d2defee..92e2507428439e70f93584422a6c82be29bfdbec 100755 (executable)
--- a/configure
+++ b/configure
@@ -3612,7 +3612,7 @@ MAGICK_LIBRARY_CURRENT_MIN=`expr $MAGICK_LIBRARY_CURRENT - $MAGICK_LIBRARY_AGE`
 
 MAGICK_LIBRARY_VERSION_INFO=$MAGICK_LIBRARY_CURRENT:$MAGICK_LIBRARY_REVISION:$MAGICK_LIBRARY_AGE
 
-MAGICK_SVN_REVISION=6837
+MAGICK_SVN_REVISION=6876
 
 
 
@@ -7992,7 +7992,7 @@ else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <stdlib.h>
-         static void foo(void) __attribute__ ((unused));
+         static void foo(void) __attribute__ ((__unused__));
          static void
          foo(void) {
              exit(1);
@@ -8024,6 +8024,46 @@ $as_echo "#define HAVE___ATTRIBUTE__ 1" >>confdefs.h
   fi
 
 
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __alloc_size__" >&5
+$as_echo_n "checking for __alloc_size__... " >&6; }
+if ${ax_cv___alloc_size__+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdlib.h>
+         static void foo(const size_t) __attribute__((__alloc_size__(1)));
+         static void
+         foo(const size_t bar) {
+             exit(1);
+         }
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ax_cv___alloc_size__=yes
+else
+  ax_cv___alloc_size__=no
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv___alloc_size__" >&5
+$as_echo "$ax_cv___alloc_size__" >&6; }
+  if test "$ax_cv___alloc_size__" = "yes"; then
+
+$as_echo "#define HAVE___ALLOC_SIZE__ 1" >>confdefs.h
+
+  fi
+
+
 
 if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
        if test -n "$ac_tool_prefix"; then
index f16c6f12619c1c749b132152bd10ac458e3cd03d..b18999cfe815583b8c1b84be54c9fc65bb09378d 100755 (executable)
@@ -261,6 +261,7 @@ AC_PROG_MAKE_SET
 AC_PROG_LN_S
 AM_WITH_DMALLOC
 AX_C___ATTRIBUTE__
+AX_C___ALLOC_SIZE__
 PKG_PROG_PKG_CONFIG
 
 #
diff --git a/m4/ax_c___alloc_size__.m4 b/m4/ax_c___alloc_size__.m4
new file mode 100644 (file)
index 0000000..c26fe91
--- /dev/null
@@ -0,0 +1,66 @@
+# ===========================================================================
+#    http://www.gnu.org/software/autoconf-archive/ax_c___alloc_size__.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+#   AX_C___ALLOC_SIZE__
+#
+# DESCRIPTION
+#
+#   Provides a test for the compiler support of __alloc_size__ extensions.
+#   Defines HAVE___ALLOC_SIZE__ if it is found.
+#
+# LICENSE
+#
+#   Copyright (c) 2008 Stepan Kasal <skasal@redhat.com>
+#   Copyright (c) 2008 Christian Haggstrom
+#   Copyright (c) 2008 Ryan McCabe <ryan@numb.org>
+#
+#   This program is free software; you can redistribute it and/or modify it
+#   under the terms of the GNU General Public License as published by the
+#   Free Software Foundation; either version 2 of the License, or (at your
+#   option) any later version.
+#
+#   This program is distributed in the hope that it will be useful, but
+#   WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+#   Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License along
+#   with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+#   As a special exception, the respective Autoconf Macro's copyright owner
+#   gives unlimited permission to copy, distribute and modify the configure
+#   scripts that are the output of Autoconf when processing the Macro. You
+#   need not follow the terms of the GNU General Public License when using
+#   or distributing such scripts, even though portions of the text of the
+#   Macro appear in them. The GNU General Public License (GPL) does govern
+#   all other use of the material that constitutes the Autoconf Macro.
+#
+#   This special exception to the GPL applies to versions of the Autoconf
+#   Macro released by the Autoconf Archive. When you make and distribute a
+#   modified version of the Autoconf Macro, you may extend this special
+#   exception to the GPL to apply to your modified version as well.
+
+#serial 8
+
+AC_DEFUN([AX_C___ALLOC_SIZE__], [
+  AC_CACHE_CHECK([for __alloc_size__], [ax_cv___alloc_size__],
+    [AC_COMPILE_IFELSE(
+      [AC_LANG_PROGRAM(
+       [[#include <stdlib.h>
+         static void foo(const size_t) __attribute__((__alloc_size__(1)));
+         static void
+         foo(const size_t bar) {
+             exit(1);
+         }
+        ]], [])],
+      [ax_cv___alloc_size__=yes],
+      [ax_cv___alloc_size__=no]
+    )
+  ])
+  if test "$ax_cv___alloc_size__" = "yes"; then
+    AC_DEFINE([HAVE___ALLOC_SIZE__], 1, [define if your compiler has __alloc_size__])
+  fi
+])
index cf3d62bbdf4f516178bb78563b7a5a04e51bde42..25b7c93c62bcf3e676c0ea2ea754892aea6c1b7e 100644 (file)
@@ -50,7 +50,7 @@ AC_DEFUN([AX_C___ATTRIBUTE__], [
     [AC_COMPILE_IFELSE(
       [AC_LANG_PROGRAM(
        [[#include <stdlib.h>
-         static void foo(void) __attribute__ ((unused));
+         static void foo(void) __attribute__ ((__unused__));
          static void
          foo(void) {
              exit(1);