[devel] Eliminated PNG_NO_EXTERN and PNG_ALL_EXTERN

This commit is contained in:
Glenn Randers-Pehrson 2010-03-16 19:30:01 -05:00
parent 8069aeb88e
commit 4c8f7269ff
7 changed files with 27 additions and 33 deletions

View File

@ -1,5 +1,5 @@
Libpng 1.5.0beta15 - March 16, 2010 Libpng 1.5.0beta15 - March 17, 2010
This is not intended to be a public release. It will be replaced This is not intended to be a public release. It will be replaced
within a few weeks by a public version or by another test version. within a few weeks by a public version or by another test version.
@ -124,11 +124,12 @@ version 1.5.0beta14 [March 14, 2010]
platforms on which it happened (all but Mac OS and RISC OS). platforms on which it happened (all but Mac OS and RISC OS).
Moved the Mac OS test into pngpriv.h (the only place it is used.) Moved the Mac OS test into pngpriv.h (the only place it is used.)
version 1.5.0beta14 [March 16, 2010] version 1.5.0beta14 [March 17, 2010]
Added symbols.chk target to Makefile.am to validate the symbols in png.h Added symbols.chk target to Makefile.am to validate the symbols in png.h
against the new DEF file scripts/symbols.def. against the new DEF file scripts/symbols.def.
Changed the default DEF file back to pngwin.def. Changed the default DEF file back to pngwin.def.
Removed makefile.mingw. Removed makefile.mingw.
Eliminated PNG_NO_EXTERN and PNG_ALL_EXTERN
Send comments/corrections/commendations to png-mng-implement at lists.sf.net Send comments/corrections/commendations to png-mng-implement at lists.sf.net
(subscription required; visit (subscription required; visit

View File

@ -2601,11 +2601,13 @@ version 1.5.0beta14 [March 14, 2010]
platforms on which it happened (all but Mac OS and RISC OS). platforms on which it happened (all but Mac OS and RISC OS).
Moved the Mac OS test into pngpriv.h (the only place it is used.) Moved the Mac OS test into pngpriv.h (the only place it is used.)
version 1.5.0beta14 [March 16, 2010] version 1.5.0beta14 [March 17, 2010]
Added symbols.chk target to Makefile.am to validate the symbols in png.h Added symbols.chk target to Makefile.am to validate the symbols in png.h
against the new DEF file scripts/symbols.def. against the new DEF file scripts/symbols.def.
Changed the default DEF file back to pngwin.def. Changed the default DEF file back to pngwin.def.
Removed makefile.mingw. Removed makefile.mingw.
Eliminated PNG_NO_EXTERN and PNG_ALL_EXTERN
Send comments/corrections/commendations to png-mng-implement at lists.sf.net Send comments/corrections/commendations to png-mng-implement at lists.sf.net
(subscription required; visit (subscription required; visit

View File

@ -94,17 +94,18 @@ SYMBOL_CFLAGS = -DPNGLIB_LIBNAME='PNG@PNGLIB_MAJOR@@PNGLIB_MINOR@_0'\
-DSYMBOL_PREFIX='$(SYMBOL_PREFIX)' -DSYMBOL_PREFIX='$(SYMBOL_PREFIX)'
libpng.sym libpng.vers libpng.def checksym.lst: libpng.sym libpng.vers libpng.def checksym.lst:
$(RM) $@ dfn.c dfn?.out rm -f $@ dfn.c dfn?.out
echo '#include "$<"' >dfn.c echo '#include "$<"' >dfn.c
$(CPP) @LIBPNG_DEFINES@ $(CPPFLAGS) $(SYMBOL_CFLAGS) dfn.c >dfn1.out $(CPP) @LIBPNG_DEFINES@ $(CPPFLAGS) $(SYMBOL_CFLAGS) dfn.c >dfn1.out
$(SED) -n -e 's|^.*PNG_DEFN_MAGIC-\(.*\)-PNG_DEFN_END.*$$|\1|p' dfn1.out >dfn2.out $(SED) -n -e 's|^.*PNG_DEFN_MAGIC-\(.*\)-PNG_DEFN_END.*$$|\1|p' dfn1.out >dfn2.out
$(SED) -e 's| *@@@ *||' -e 's| *$$||' dfn2.out >dfn3.out $(SED) -e 's| *@@@ *||' -e 's| *$$||' dfn2.out >dfn3.out
$(RM) dfn.c dfn[12].out rm -f dfn.c dfn[12].out
mv dfn3.out $@ mv dfn3.out $@
symbols.chk: scripts/checksym.awk scripts/symbols.def checksym.lst symbols.chk: scripts/checksym.awk scripts/symbols.def checksym.lst
$(RM) $@ symbols.new rm -f $@ symbols.new
$(AWK) -f $^ >&2 $(AWK) -f ${srcdir}/scripts/checksym.awk ${srcdir}/scripts/symbols.def\
checksym.lst >&2
mv symbols.new $@ mv symbols.new $@
dist: symbols.chk dist: symbols.chk

View File

@ -1219,17 +1219,18 @@ libpng.def: scripts/def.dfn png.h pngconf.h
checksym.lst: scripts/checksym.dfn png.h pngconf.h checksym.lst: scripts/checksym.dfn png.h pngconf.h
libpng.sym libpng.vers libpng.def checksym.lst: libpng.sym libpng.vers libpng.def checksym.lst:
$(RM) $@ dfn.c dfn?.out rm -f $@ dfn.c dfn?.out
echo '#include "$<"' >dfn.c echo '#include "$<"' >dfn.c
$(CPP) @LIBPNG_DEFINES@ $(CPPFLAGS) $(SYMBOL_CFLAGS) dfn.c >dfn1.out $(CPP) @LIBPNG_DEFINES@ $(CPPFLAGS) $(SYMBOL_CFLAGS) dfn.c >dfn1.out
$(SED) -n -e 's|^.*PNG_DEFN_MAGIC-\(.*\)-PNG_DEFN_END.*$$|\1|p' dfn1.out >dfn2.out $(SED) -n -e 's|^.*PNG_DEFN_MAGIC-\(.*\)-PNG_DEFN_END.*$$|\1|p' dfn1.out >dfn2.out
$(SED) -e 's| *@@@ *||' -e 's| *$$||' dfn2.out >dfn3.out $(SED) -e 's| *@@@ *||' -e 's| *$$||' dfn2.out >dfn3.out
$(RM) dfn.c dfn[12].out rm -f dfn.c dfn[12].out
mv dfn3.out $@ mv dfn3.out $@
symbols.chk: scripts/checksym.awk scripts/symbols.def checksym.lst symbols.chk: scripts/checksym.awk scripts/symbols.def checksym.lst
$(RM) $@ symbols.new rm -f $@ symbols.new
$(AWK) -f $^ >&2 $(AWK) -f ${srcdir}/scripts/checksym.awk ${srcdir}/scripts/symbols.def\
checksym.lst >&2
mv symbols.new $@ mv symbols.new $@
dist: symbols.chk dist: symbols.chk

10
png.c
View File

@ -1,7 +1,7 @@
/* png.c - location for general purpose libpng functions /* png.c - location for general purpose libpng functions
* *
* Last changed in libpng 1.5.0 [March 14, 2010] * Last changed in libpng 1.5.0 [March 17, 2010]
* Copyright (c) 1998-2010 Glenn Randers-Pehrson * Copyright (c) 1998-2010 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
@ -11,7 +11,6 @@
* and license in png.h * and license in png.h
*/ */
#define PNG_NO_EXTERN
#include "pngpriv.h" #include "pngpriv.h"
/* Generate a compiler error if there is an old png.h in the search path. */ /* Generate a compiler error if there is an old png.h in the search path. */
@ -549,13 +548,13 @@ png_get_copyright(png_structp png_ptr)
#else #else
# ifdef __STDC__ # ifdef __STDC__
return ((png_charp) PNG_STRING_NEWLINE \ return ((png_charp) PNG_STRING_NEWLINE \
"libpng version 1.5.0beta15 - March 14, 2010" PNG_STRING_NEWLINE \ "libpng version 1.5.0beta15 - March 17, 2010" PNG_STRING_NEWLINE \
"Copyright (c) 1998-2010 Glenn Randers-Pehrson" PNG_STRING_NEWLINE \ "Copyright (c) 1998-2010 Glenn Randers-Pehrson" PNG_STRING_NEWLINE \
"Copyright (c) 1996-1997 Andreas Dilger" PNG_STRING_NEWLINE \ "Copyright (c) 1996-1997 Andreas Dilger" PNG_STRING_NEWLINE \
"Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc." \ "Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc." \
PNG_STRING_NEWLINE); PNG_STRING_NEWLINE);
# else # else
return ((png_charp) "libpng version 1.5.0beta15 - March 14, 2010\ return ((png_charp) "libpng version 1.5.0beta15 - March 17, 2010\
Copyright (c) 1998-2010 Glenn Randers-Pehrson\ Copyright (c) 1998-2010 Glenn Randers-Pehrson\
Copyright (c) 1996-1997 Andreas Dilger\ Copyright (c) 1996-1997 Andreas Dilger\
Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc."); Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.");
@ -575,8 +574,7 @@ png_charp PNGAPI
png_get_libpng_ver(png_structp png_ptr) png_get_libpng_ver(png_structp png_ptr)
{ {
/* Version of *.c files used when building libpng */ /* Version of *.c files used when building libpng */
png_ptr = png_ptr; /* Silence compiler warning about unused png_ptr */ return png_get_header_ver(png_ptr);
return ((png_charp) PNG_LIBPNG_VER_STRING);
} }
png_charp PNGAPI png_charp PNGAPI

16
png.h
View File

@ -1,7 +1,7 @@
/* png.h - header file for PNG reference library /* png.h - header file for PNG reference library
* *
* libpng version 1.5.0beta15 - March 16, 2010 * libpng version 1.5.0beta15 - March 17, 2010
* Copyright (c) 1998-2010 Glenn Randers-Pehrson * Copyright (c) 1998-2010 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
@ -11,7 +11,7 @@
* Authors and maintainers: * Authors and maintainers:
* libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat * libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat
* libpng versions 0.89c, June 1996, through 0.96, May 1997: Andreas Dilger * libpng versions 0.89c, June 1996, through 0.96, May 1997: Andreas Dilger
* libpng versions 0.97, January 1998, through 1.5.0beta15 - March 16, 2010: Glenn * libpng versions 0.97, January 1998, through 1.5.0beta15 - March 17, 2010: Glenn
* See also "Contributing Authors", below. * See also "Contributing Authors", below.
* *
* Note about libpng version numbers: * Note about libpng version numbers:
@ -170,7 +170,7 @@
* *
* This code is released under the libpng license. * This code is released under the libpng license.
* *
* libpng versions 1.2.6, August 15, 2004, through 1.5.0beta15, March 16, 2010, are * libpng versions 1.2.6, August 15, 2004, through 1.5.0beta15, March 17, 2010, are
* Copyright (c) 2004, 2006-2010 Glenn Randers-Pehrson, and are * Copyright (c) 2004, 2006-2010 Glenn Randers-Pehrson, and are
* distributed according to the same disclaimer and license as libpng-1.2.5 * distributed according to the same disclaimer and license as libpng-1.2.5
* with the following individual added to the list of Contributing Authors: * with the following individual added to the list of Contributing Authors:
@ -282,7 +282,7 @@
* Y2K compliance in libpng: * Y2K compliance in libpng:
* ========================= * =========================
* *
* March 16, 2010 * March 17, 2010
* *
* Since the PNG Development group is an ad-hoc body, we can't make * Since the PNG Development group is an ad-hoc body, we can't make
* an official declaration. * an official declaration.
@ -346,7 +346,7 @@
/* Version information for png.h - this should match the version in png.c */ /* Version information for png.h - this should match the version in png.c */
#define PNG_LIBPNG_VER_STRING "1.5.0beta15" #define PNG_LIBPNG_VER_STRING "1.5.0beta15"
#define PNG_HEADER_VERSION_STRING \ #define PNG_HEADER_VERSION_STRING \
" libpng version 1.5.0beta15 - March 16, 2010\n" " libpng version 1.5.0beta15 - March 17, 2010\n"
#define PNG_LIBPNG_VER_SONUM 15 #define PNG_LIBPNG_VER_SONUM 15
#define PNG_LIBPNG_VER_DLLNUM 15 #define PNG_LIBPNG_VER_DLLNUM 15
@ -433,14 +433,10 @@ extern "C" {
* which applications aren't expected to use directly. * which applications aren't expected to use directly.
*/ */
/* Variables declared in png.c - only it needs to define PNG_NO_EXTERN */
#if !defined(PNG_NO_EXTERN) || defined(PNG_ALWAYS_EXTERN)
/* Version information for C files, stored in png.c. This had better match /* Version information for C files, stored in png.c. This had better match
* the version above. * the version above.
*/ */
# define png_libpng_ver png_get_header_ver(NULL) #define png_libpng_ver png_get_header_ver(NULL)
#endif /* PNG_NO_EXTERN */
/* Three color definitions. The order of the red, green, and blue, (and the /* Three color definitions. The order of the red, green, and blue, (and the
* exact size) is not important, although the size of the fields need to * exact size) is not important, although the size of the fields need to

View File

@ -1,7 +1,7 @@
/* pngpriv.h - private declarations for use inside libpng /* pngpriv.h - private declarations for use inside libpng
* *
* libpng version 1.5.0beta15 - March 14, 2010 * libpng version 1.5.0beta15 - March 17, 2010
* For conditions of distribution and use, see copyright notice in png.h * For conditions of distribution and use, see copyright notice in png.h
* Copyright (c) 1998-2010 Glenn Randers-Pehrson * Copyright (c) 1998-2010 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
@ -77,11 +77,6 @@
# endif # endif
#endif #endif
/* Codewarrior on NT has linking problems without this. */
#if (defined(__MWERKS__) && defined(WIN32)) || defined(__STDC__)
# define PNG_ALWAYS_EXTERN
#endif
/* This provides the non-ANSI (far) memory allocation routines. */ /* This provides the non-ANSI (far) memory allocation routines. */
#if defined(__TURBOC__) && defined(__MSDOS__) #if defined(__TURBOC__) && defined(__MSDOS__)
# include <mem.h> # include <mem.h>