summaryrefslogtreecommitdiffhomepage
path: root/libpng/pngconf.h
diff options
context:
space:
mode:
Diffstat (limited to 'libpng/pngconf.h')
-rw-r--r--libpng/pngconf.h95
1 files changed, 39 insertions, 56 deletions
diff --git a/libpng/pngconf.h b/libpng/pngconf.h
index c82fa58..2633bf8 100644
--- a/libpng/pngconf.h
+++ b/libpng/pngconf.h
@@ -1,7 +1,7 @@
/* pngconf.h - machine configurable file for libpng
*
- * libpng version 1.5.2 - March 31, 2011
+ * libpng version 1.5.1 - February 3, 2011
*
* Copyright (c) 1998-2011 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
@@ -22,31 +22,29 @@
#ifndef PNGCONF_H
#define PNGCONF_H
-#ifndef PNG_BUILDING_SYMBOL_TABLE
/* PNG_NO_LIMITS_H may be used to turn off the use of the standard C
* definition file for machine specific limits, this may impact the
* correctness of the definitons below (see uses of INT_MAX).
*/
-# ifndef PNG_NO_LIMITS_H
-# include <limits.h>
-# endif
+#ifndef PNG_NO_LIMITS_H
+# include <limits.h>
+#endif
/* For the memory copy APIs (i.e. the standard definitions of these),
* because this file defines png_memcpy and so on the base APIs must
* be defined here.
*/
-# ifdef BSD
-# include <strings.h>
-# else
-# include <string.h>
-# endif
+#ifdef BSD
+# include <strings.h>
+#else
+# include <string.h>
+#endif
/* For png_FILE_p - this provides the standard definition of a
* FILE
*/
-# ifdef PNG_STDIO_SUPPORTED
-# include <stdio.h>
-# endif
+#ifdef PNG_STDIO_SUPPORTED
+# include <stdio.h>
#endif
/* This controls optimization of the reading of 16 and 32 bit values
@@ -284,15 +282,23 @@
# endif
#endif
-/* In 1.5.2 the definition of PNG_FUNCTION has been changed to always treat
- * 'attributes' as a storage class - the attributes go at the start of the
- * function definition, and attributes are always appended regardless of the
- * compiler. This considerably simplifies these macros but may cause problems
- * if any compilers both need function attributes and fail to handle them as
- * a storage class (this is unlikely.)
+/* THe following complexity is concerned with getting the 'attributes' of the
+ * declared function in the correct place. This potentially requires a separate
+ * PNG_EXPORT function for every compiler.
*/
#ifndef PNG_FUNCTION
-# define PNG_FUNCTION(type, name, args, attributes) attributes type name args
+# ifdef __GNUC__
+# define PNG_FUNCTION(type, name, args, attributes)\
+ attributes type name args
+# else /* !GNUC */
+# ifdef _MSC_VER
+# define PNG_FUNCTION(type, name, args, attributes)\
+ attributes type name args
+# else /* !MSC */
+# define PNG_FUNCTION(type, name, args, attributes)\
+ type name args
+# endif
+# endif
#endif
#ifndef PNG_EXPORT_TYPE
@@ -304,19 +310,13 @@
* scripts directory.
*/
#ifndef PNG_EXPORTA
-
# define PNG_EXPORTA(ordinal, type, name, args, attributes)\
- PNG_FUNCTION(PNG_EXPORT_TYPE(type),(PNGAPI name),PNGARG(args), \
- extern attributes)
+ extern PNG_FUNCTION(PNG_EXPORT_TYPE(type),(PNGAPI name),PNGARG(args),\
+ attributes)
#endif
-/* ANSI-C (C90) does not permit a macro to be invoked with an empty argument,
- * so make something non-empty to satisfy the requirement:
- */
-#define PNG_EMPTY /*empty list*/
-
#define PNG_EXPORT(ordinal, type, name, args)\
- PNG_EXPORTA(ordinal, type, name, args, PNG_EMPTY)
+ PNG_EXPORTA(ordinal, type, name, args, )
/* Use PNG_REMOVED to comment out a removed interface. */
#ifndef PNG_REMOVED
@@ -324,7 +324,8 @@
#endif
#ifndef PNG_CALLBACK
-# define PNG_CALLBACK(type, name, args) type (PNGCBAPI name) PNGARG(args)
+# define PNG_CALLBACK(type, name, args, attributes)\
+ type (PNGCBAPI name) PNGARG(args) attributes
#endif
/* Support for compiler specific function attributes. These are used
@@ -346,7 +347,7 @@
* functions in png.h will generate compiler warnings. Added at libpng
* version 1.2.41.
*/
-# if defined(__GNUC__)
+# ifdef __GNUC__
# ifndef PNG_USE_RESULT
# define PNG_USE_RESULT __attribute__((__warn_unused_result__))
# endif
@@ -354,21 +355,7 @@
# define PNG_NORETURN __attribute__((__noreturn__))
# endif
# ifndef PNG_PTR_NORETURN
- /* It's not enough to have the compiler be the correct compiler at
- * this point - it's necessary for the library (which defines
- * the type of the library longjmp) to also be the GNU library.
- * This is because many systems use the GNU compiler with a
- * non-GNU libc implementation. Min/GW headers are also compatible
- * with GCC as well as uclibc, so it seems best to exclude known
- * problem libcs here rather than just including known libcs.
- *
- * NOTE: this relies on the only use of PNG_PTR_NORETURN being with
- * the system longjmp. If the same type is used elsewhere then this
- * will need to be changed.
- */
-# if !defined(__CYGWIN__)
-# define PNG_PTR_NORETURN __attribute__((__noreturn__))
-# endif
+# define PNG_PTR_NORETURN __attribute__((__noreturn__))
# endif
# ifndef PNG_ALLOCATED
# define PNG_ALLOCATED __attribute__((__malloc__))
@@ -393,19 +380,18 @@
# define PNG_PRIVATE \
__attribute__((__deprecated__))
# endif
-# endif
+# endif /* PNG_PRIVATE */
# endif /* PNGLIB_BUILD */
# endif /* __GNUC__ */
-
-# if defined(_MSC_VER) && (_MSC_VER >= 1300)
+# ifdef _MSC_VER /* may need to check value */
# ifndef PNG_USE_RESULT
-# define PNG_USE_RESULT /* not supported */
+# define PNG_USE_RESULT /*not supported*/
# endif
# ifndef PNG_NORETURN
# define PNG_NORETURN __declspec(noreturn)
# endif
# ifndef PNG_PTR_NORETURN
-# define PNG_PTR_NORETURN /* not supported */
+# define PNG_PTR_NORETURN /*not supported*/
# endif
# ifndef PNG_ALLOCATED
# define PNG_ALLOCATED __declspec(restrict)
@@ -424,9 +410,9 @@
# endif
# ifndef PNG_PRIVATE
# define PNG_PRIVATE __declspec(deprecated)
-# endif
+# endif /* PNG_PRIVATE */
# endif /* PNGLIB_BUILD */
-# endif /* _MSC_VER */
+# endif /* __GNUC__ */
#endif /* PNG_PEDANTIC_WARNINGS */
#ifndef PNG_DEPRECATED
@@ -438,9 +424,6 @@
#ifndef PNG_NORETURN
# define PNG_NORETURN /* This function does not return */
#endif
-#ifndef PNG_PTR_NORETURN
-# define PNG_PTR_NORETURN /* This function does not return */
-#endif
#ifndef PNG_ALLOCATED
# define PNG_ALLOCATED /* The result of the function is new memory */
#endif