[libpng15] Fix for the preprocessor of the Intel C compiler. The preprocessor

adjacent @ signs with a space; this changes the concatentation
from @@@ to PNG_JOIN; that should work with all compiler
preprocessors.
This commit is contained in:
John Bowler 2011-11-03 18:19:53 -05:00 committed by Glenn Randers-Pehrson
parent aff44028ba
commit 1d8b75550f
8 changed files with 23 additions and 14 deletions

View File

@ -33,6 +33,10 @@ Version 1.5.7 [November 3, 2011]
of a png_struct or png_info failed. This would probably have led to a
crash. The pngmem.c implementation of png_malloc() included a cast
to png_size_t which would fail on large allocations on 16-bit systems.
Fix for the preprocessor of the Intel C compiler. The preprocessor
splits adjacent @ signs with a space; this changes the concatentation
token from @@@ to PNG_JOIN; that should work with all compiler
preprocessors.
Send comments/corrections/commendations to png-mng-implement at lists.sf.net:
(subscription required; visit

View File

@ -3676,6 +3676,10 @@ Version 1.5.7 [November 3, 2011]
of a png_struct or png_info failed. This would probably have led to a
crash. The pngmem.c implementation of png_malloc() included a cast
to png_size_t which would fail on large allocations on 16-bit systems.
Fix for the preprocessor of the Intel C compiler. The preprocessor
splits adjacent @ signs with a space; this changes the concatentation
token from @@@ to PNG_JOIN; that should work with all compiler
preprocessors.
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
(subscription required; visit

View File

@ -142,9 +142,9 @@ SYMBOL_CFLAGS = -DPNGLIB_LIBNAME='PNG@PNGLIB_MAJOR@@PNGLIB_MINOR@_0'\
echo '#include "$<"' >dfn.c
$(DFNCPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) @LIBPNG_DEFINES@\
$(CPPFLAGS) $(SYMBOL_CFLAGS) dfn.c > dfn1.out
$(SED) -n -e 's|^.*PNG_DEFN_MAGIC-\(.*\)-PNG_DEFN_END.*$$|\1|p'\
$(SED) -n -e 's|^.*PNG_DEFN_MAGIC *-\(.*\)- *PNG_DEFN_END.*$$|\1|p'\
dfn1.out >dfn2.out
$(SED) -e 's| *@@@ *||g' -e 's| *$$||' dfn2.out >dfn3.out
$(SED) -e 's| *PNG_JOIN *||g' -e 's| *$$||' dfn2.out >dfn3.out
rm -f dfn.c dfn[12].out
mv dfn3.out $@

View File

@ -1340,9 +1340,9 @@ pngvalid.o pngtest.o: pnglibconf.h
echo '#include "$<"' >dfn.c
$(DFNCPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) @LIBPNG_DEFINES@\
$(CPPFLAGS) $(SYMBOL_CFLAGS) dfn.c > dfn1.out
$(SED) -n -e 's|^.*PNG_DEFN_MAGIC-\(.*\)-PNG_DEFN_END.*$$|\1|p'\
$(SED) -n -e 's|^.*PNG_DEFN_MAGIC *-\(.*\)- *PNG_DEFN_END.*$$|\1|p'\
dfn1.out >dfn2.out
$(SED) -e 's| *@@@ *||g' -e 's| *$$||' dfn2.out >dfn3.out
$(SED) -e 's| *PNG_JOIN *||g' -e 's| *$$||' dfn2.out >dfn3.out
rm -f dfn.c dfn[12].out
mv dfn3.out $@

View File

@ -27,12 +27,12 @@ S--E
S-EXPORTS-E
S-;Version 1.5.0beta58-E
/* NOTE: @@@ is interpreted by the calling script as a signal to
/* NOTE: PNG_JOIN is interpreted by the calling script as a signal to
* join the two things on either side, so we can do symbol
* substitution within the name, regular C ## joins the pp-tokens,
* not their final values.
*/
#define PNG_EXPORTA(ordinal, type, name, args, attributes)\
PNG_DEFN_MAGIC- SYMBOL_PREFIX @@@ name-PNG_DEFN_END
PNG_DEFN_MAGIC- SYMBOL_PREFIX PNG_JOIN name-PNG_DEFN_END
#include "../png.h"

View File

@ -35,13 +35,14 @@ BEGIN{
err=0 # in-line exit sets this
start="PNG_DEFN_MAGIC-" # Arbitrary start
end="-PNG_DEFN_END" # Arbitrary end
cx= "/@@@*" # Open C comment for output file
ct="PNG_JOIN" # Join two tokens
cx= "/" ct "*" # Open C comment for output file
comment=start cx # Comment start
cend="*/" end # Comment end
def=start "#define PNG_@@@" # Arbitrary define
sup="@@@_SUPPORTED" end # end supported option
und=comment "#undef PNG_@@@" # Unsupported option
une="@@@_SUPPORTED" cend # end unsupported option
def=start "#define PNG_" ct # Arbitrary define
sup=ct "_SUPPORTED" end # end supported option
und=comment "#undef PNG_" ct # Unsupported option
une=ct "_SUPPORTED" cend # end unsupported option
error=start "ERROR:" # error message
# Variables

View File

@ -10,6 +10,6 @@
*/
#define PNG_EXPORTA(ordinal, type, name, args, attributes)\
PNG_DEFN_MAGIC-SYMBOL_PREFIX @@@ name-PNG_DEFN_END
PNG_DEFN_MAGIC-SYMBOL_PREFIX PNG_JOIN name-PNG_DEFN_END
#include "../png.h"

View File

@ -11,13 +11,13 @@
#define HEADER PNG_DEFN_MAGIC-PNGLIB_LIBNAME {global:-PNG_DEFN_END
/* NOTE: @@@ is interpreted by the calling script as a signal to
/* NOTE: PNG_JOIN is interpreted by the calling script as a signal to
* join the two things on either side, so we can do symbol
* substitution within the name, regular C ## joins the pp-tokens,
* not their final values.
*/
#define PNG_EXPORTA(ordinal, type, name, args, attributes)\
PNG_DEFN_MAGIC- SYMBOL_PREFIX @@@ name;-PNG_DEFN_END
PNG_DEFN_MAGIC- SYMBOL_PREFIX PNG_JOIN name;-PNG_DEFN_END
#define TRAILER PNG_DEFN_MAGIC-local: *; };-PNG_DEFN_END