"Kevin Oberman" <oberman(a)es.net> writes:
> From: wmperry(a)aventail.com (William M. Perry)
> Date: 04 Jun 1998 08:10:56 -0500
> Sender: owner-xemacs-beta(a)xemacs.org
>
> Could the definition of CONST somehow be different between the .h and .c
> files? Some .h file included after glyphs.h doing the definition, or
> redoing it, etc?
Give the man the prize! I already had guessed this to be the case, but
had not had time to look. Now I have and that is it.
In the case of glyphs.h, CONST is defined as "const" but by the time
the read_bitmap_data_from_file is reached in the main code, it has
been re-defined as "". I believe this is being done by zconf.h called
from zlib.h. It does not redefine CONST, but defines const to nothing.
I can "fix" the problem so that the compiler only gives a warning by
adding
#define const const
after the
#include <png.h>
I still get the warning:
cc: Warning: glyphs-x.c, line 69: The redefinition of the macro "const"
conflicts with a current definition because the replacement lists differ. The
redefinition is now in effect.
#define const const
--------------^
Now I must wonder why gcc does not have a problem with the
inconsistency in the "const". Looks to me like it should complain,
too.
Yuck. You could always just do
#undef const
#define const CONST
Or something equally weird like that. :)
-Bill P.