I am using DevC++ & MinGW for GRX. If I have a defined constant 'white' (as a color index) then attempt to use GrWhite() a "parse error before numeric constant" is reported. E.g.
#include <grx20.h> #include <grxkeys.h>
#define white 0
GrColor White;
int main(void) { GrSetMode(GR_default_graphics); White = GrWhite();/* gives "parse error before numeric constant" */
/* White = GrAllocColor(255,255,255); */ return(0); }
If I remove my 'define' all is well, as is if I use GrAlloc instead of GrWhite.
Peter Williams a écrit:
I am using DevC++ & MinGW for GRX. If I have a defined constant 'white' (as a color index) then attempt to use GrWhite() a "parse error before numeric constant" is reported. E.g.
#include <grx20.h> #include <grxkeys.h>
#define white 0
GrColor White;
int main(void) { GrSetMode(GR_default_graphics); White = GrWhite();/* gives "parse error before numeric constant" */
/* White = GrAllocColor(255,255,255); */ return(0); }
If I remove my 'define' all is well, as is if I use GrAlloc instead of GrWhite.
I find in grx20.h
#define GrWhite() ( \ (GrColorInfo->white == GrNOCOLOR) ? \ (GrWhite)() : \ GrColorInfo->white \
and you redefine white so that the second line becomes
(GrColorInfo->0 == GrNOCOLOR) ? \
???
Maurice
On Tue, 30 Mar 2004 15:47:25 +0100, Peter Williams peter.williams173@ntlworld.com wrote:
I am using DevC++ & MinGW for GRX. If I have a defined constant 'white' (as a color index) then attempt to use GrWhite() a "parse error before numeric constant" is reported.
From grx20.h:
#define GrWhite() ( \ (GrColorInfo->white == GrNOCOLOR) ? \ (GrWhite)() : \ GrColorInfo->white \ )
It isn't very good idea to #define commonly used words, such as white, alloc or shift. You'd better #define WHITE. That'll conflict with <libbcc.h> (BGI traditionally defines it) and "gfaz.h", but your example will be OK. Or you can #define GRX_SKIP_INLINES before #include <grx20.h>, that should also do.