[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-gnubg] Proposed patches to the gnubg sources

From: Jim Segrave
Subject: Re: [Bug-gnubg] Proposed patches to the gnubg sources
Date: Mon, 7 Feb 2005 15:41:19 +0000
User-agent: Mutt/

On Mon 07 Feb 2005 (10:34 +0000), Jon Kinsey wrote:
> macherius wrote:
> >jon_kinsey wrote:
> >
> >
> >>>* board3d/ drawboard.c font3d.cpp graph.c gtkcolour.c matrix.c misc3d.c
> >
> >model.c shadow.c
> >
> >>>widget3d.c
> >>>- include windows.h before GL headers, otherwise definitions in the Open
> >
> >GL headers are
> >
> >>>missing and yieding compiler errors
> >>
> >>A better(?) fix is to add #include <windows.h> to the gl.h microsoft
> >
> >include file - it should > be in there and all the other gl.h files I've
> >come across are fine.
> >
> >You are the maintainers here, but I don't like the idea to change third
> >party headers to compile just any open souce. Gnubg was harder to compile
> >than anything else I ported so far, and that included some weird stuff like
> >gcc for Sinix on MIPS. Checkout, compile and face dozens of unnecessary
> >warnings and errors. Is it really required to have such oddities, in
> >particular where the patches to gnubg are there, and come at no cost?
> I'm not that bothered to be fair.  Perhaps if the #if also checked
> _MSC_VER - i.e. is the microsoft compiler being used it would be ok.
> Jon

Here's a cleaner alternative:

in the various board3d files GL/gl.h and sometimes other GL/xxx.h
files are included. Why not create a local include file - glstuff.h


#ifndef _GLSTUFF_H
#define _GLSTUFF_H
#if WIN32
#include <windows.h>

#include <GL/gl.h>
#include <GL/xxx.h>
#endif /* _GLSTUFF_H */

Then replace all the GL/xxx.h includes with this single one. That
leaves the distribution files unscathed, ensures that windows.h is
always read if needed and makes the .c files a tiny bit shorter

But that makes me wonder:

in widget3d.c, near the top there is 
#if !WIN32
#include <GL/glx.h>

Which assumes WIN32 is #defined and set to FALSE
later there is

#ifdef WIN32

#define PFD_GENERIC_ACCELERATED     0x00001000

Which is going to be active, even if WIN32 is defined as FALSE, since
the test is for definition, not the value.

This can't be right, although it's probably harmless

Jim Segrave           address@hidden

reply via email to

[Prev in Thread] Current Thread [Next in Thread]