[devel] Removed the PNG_PTR_NORETURN attribute

This commit is contained in:
John Bowler 2011-04-15 06:37:34 -05:00 committed by Glenn Randers-Pehrson
parent 537c146082
commit b302c4721a
2 changed files with 7 additions and 37 deletions

21
png.h
View File

@ -846,25 +846,18 @@ typedef PNG_CALLBACK(void, *png_unknown_chunk_ptr, (png_structp));
#endif
#ifdef PNG_SETJMP_SUPPORTED
/* This must match the function definition in <setjmp.h>, and the
* application must include this before png.h to obtain the definition
* of jmp_buf. The function is required to be PNG_NORETURN. (Note that
* PNG_PTR_NORETURN is used here because current versions of the Microsoft
* C compiler do not support the PNG_NORETURN attribute on a pointer.)
/* This must match the function definition in <setjmp.h>, and the application
* must include this before png.h to obtain the definition of jmp_buf. The
* function is required to be PNG_NORETURN, but this is not checked. If the
* function does return the application will crash via an abort() or similar
* system level call.
*
* If you get a type warning from the compiler when linking against this line
* then your compiler has 'longjmp' that does not match the requirements of the
* compiler that built libpng. You will have to write a wrapper function for
* your compiler's longjmp and call png_set_longjmp_fn directly (not via the
* png_jmpbuf macro.)
*
* If you get a warning here while building the library you will need to make
* If you get a warning here while building the library you may need to make
* changes to ensure that pnglibconf.h records the calling convention used by
* your compiler. This may be very difficult - try using a different compiler
* to build the library!
*/
typedef PNG_FUNCTION(void, (PNGCAPI *png_longjmp_ptr), PNGARG((jmp_buf, int)),
PNG_PTR_NORETURN);
PNG_FUNCTION(void, (PNGCAPI *png_longjmp_ptr), PNGARG((jmp_buf, int)), typedef);
#endif
/* Transform masks for the high-level interface */

View File

@ -353,23 +353,6 @@
# ifndef PNG_NORETURN
# 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
# endif
# ifndef PNG_ALLOCATED
# define PNG_ALLOCATED __attribute__((__malloc__))
# endif
@ -404,9 +387,6 @@
# ifndef PNG_NORETURN
# define PNG_NORETURN __declspec(noreturn)
# endif
# ifndef PNG_PTR_NORETURN
# define PNG_PTR_NORETURN /* not supported */
# endif
# ifndef PNG_ALLOCATED
# define PNG_ALLOCATED __declspec(restrict)
# endif
@ -438,9 +418,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