From bf451ffc9a659fdc5ea1d11f6c22698e75d441f3 Mon Sep 17 00:00:00 2001 From: Glenn Randers-Pehrson Date: Sat, 24 Jul 2010 18:13:55 -0500 Subject: [PATCH] [master] Eliminated the new special case typedef of png_longjmp_ptr for WATCOM and made a special case "#define PNGAPI" in pngconf.h instead. --- ANNOUNCE | 2 ++ CHANGES | 2 ++ png.h | 4 ---- pngconf.h | 32 ++++++++++++++++++++------------ 4 files changed, 24 insertions(+), 16 deletions(-) diff --git a/ANNOUNCE b/ANNOUNCE index 4a18f89c8..286d99ebf 100644 --- a/ANNOUNCE +++ b/ANNOUNCE @@ -43,6 +43,8 @@ version 1.4.4beta02 [July 24, 2010] version 1.4.4beta03 [July 24, 2010] Removed reference to cbuilder5/* from Makefile.in and Makefile.am + Eliminated the new special case typedef of png_longjmp_ptr for WATCOM + and made a special case "#define PNGAPI" in pngconf.h instead. Send comments/corrections/commendations to glennrp at users.sourceforge.net or to png-mng-implement at lists.sf.net (subscription required; visit diff --git a/CHANGES b/CHANGES index 355c7e64c..c0350885b 100644 --- a/CHANGES +++ b/CHANGES @@ -2627,6 +2627,8 @@ version 1.4.4beta02 [July 24, 2010] version 1.4.4beta03 [July 24, 2010] Removed reference to cbuilder5/* from Makefile.in and Makefile.am + Eliminated the new special case typedef of png_longjmp_ptr for WATCOM + and made a special case "#define PNGAPI" in pngconf.h instead. Send comments/corrections/commendations to glennrp at users.sourceforge.net or to png-mng-implement at lists.sf.net (subscription required; visit diff --git a/png.h b/png.h index 2b514aea9..145d0d7d8 100644 --- a/png.h +++ b/png.h @@ -1053,11 +1053,7 @@ typedef void (PNGAPI *png_unknown_chunk_ptr) PNGARG((png_structp)); * application must include this before png.h to obtain the definition * of jmp_buf. */ -# ifdef __WATCOMC__ -typedef void (*png_longjmp_ptr) PNGARG((jmp_buf, int)); -# else typedef void (PNGAPI *png_longjmp_ptr) PNGARG((jmp_buf, int)); -# endif #endif /* Transform masks for the high-level interface */ diff --git a/pngconf.h b/pngconf.h index 2ade3e5ba..b050f0fe8 100644 --- a/pngconf.h +++ b/pngconf.h @@ -439,7 +439,7 @@ /* The following uses const char * instead of char * for error * and warning message functions, so some compilers won't complain. - * If you do not want to use const, define PNG_NO_CONST here. + * If you do not want to use const, define PNG_NO_CONST. */ #ifndef PNG_CONST @@ -454,8 +454,10 @@ * library that you will not be using. I wish I could figure out how to * automate this, but I can't do that without making it seriously hard * on the users. So if you are not using an ability, change the #define - * to and #undef, and that part of the library will not be compiled. If - * your linker can't find a function, you may want to make sure the + * to an #undef, or pass in PNG_NO_feature and that part of the library + * will not be compiled. + + * If your linker can't find a function, you may want to make sure the * ability is defined here. Some of these depend upon some others being * defined. I haven't figured out all the interactions here, so you may * have to experiment awhile to get everything to compile. If you are @@ -1236,6 +1238,13 @@ typedef char FAR * FAR * FAR * png_charppp; # define PNG_DLL #endif +/* If you define PNGAPI, e.g., with compiler option "-DPNGAPI=__stdcall", + * you may get warnings regarding the linkage of png_zalloc and png_zfree. + * Don't ignore those warnings; you must also reset the default calling + * convention in your compiler to match your PNGAPI, and you must build + * zlib and your applications the same way you build libpng. + */ + #ifdef __CYGWIN__ # undef PNGAPI # define PNGAPI __cdecl @@ -1243,14 +1252,11 @@ typedef char FAR * FAR * FAR * png_charppp; # define PNG_IMPEXP #endif -#define PNG_USE_LOCAL_ARRAYS /* Not used in libpng, defined for legacy apps */ - -/* If you define PNGAPI, e.g., with compiler option "-DPNGAPI=__stdcall", - * you may get warnings regarding the linkage of png_zalloc and png_zfree. - * Don't ignore those warnings; you must also reset the default calling - * convention in your compiler to match your PNGAPI, and you must build - * zlib and your applications the same way you build libpng. - */ +#ifdef __WATCOMC__ +# ifndef PNGAPI +# define PNGAPI +# endif +#endif #if defined(__MINGW32__) && !defined(PNG_MODULEDEF) # ifndef PNG_NO_MODULEDEF @@ -1267,7 +1273,7 @@ typedef char FAR * FAR * FAR * png_charppp; defined(WIN32) || defined(_WIN32) || defined(__WIN32__) )) # ifndef PNGAPI -# if defined(__GNUC__) || (defined (_MSC_VER) && (_MSC_VER >= 800)) || defined( __WATCOMC__ ) +# if defined(__GNUC__) || (defined (_MSC_VER) && (_MSC_VER >= 800)) # define PNGAPI __cdecl # else # define PNGAPI _cdecl @@ -1335,6 +1341,8 @@ typedef char FAR * FAR * FAR * png_charppp; # define PNG_EXPORT(type,symbol) PNG_IMPEXP type PNGAPI symbol #endif +#define PNG_USE_LOCAL_ARRAYS /* Not used in libpng, defined for legacy apps */ + /* Support for compiler specific function attributes. These are used * so that where compiler support is available incorrect use of API * functions in png.h will generate compiler warnings.