Mesa (master): sgi: Fix MSVC build.

Jose Fonseca jrfonseca at
Wed Apr 27 18:06:22 UTC 2011

Module: Mesa
Branch: master
Commit: fa7a051c251552c4581caadce772a29c64f6a850

Author: José Fonseca <jfonseca at>
Date:   Wed Apr 27 19:05:29 2011 +0100

sgi: Fix MSVC build.

Including windows.h was ineffective on MSVC because we define the NOGDI macro,
which skips the wingdi.h include.

Unsetting NOGDI is also a bad idea because it causes all sort of symbol
clashes with SGI code.

The real problem is that WINGDAPI was not being defined, also due to NOGDI,
so simply define it to blank if not done already.  This seems to make
everybody happy.


 src/glu/sgi/include/gluos.h  |    4 ++++
 src/glu/sgi/libutil/mipmap.c |    2 +-
 2 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/src/glu/sgi/include/gluos.h b/src/glu/sgi/include/gluos.h
index 802aa84..ac0a787 100644
--- a/src/glu/sgi/include/gluos.h
+++ b/src/glu/sgi/include/gluos.h
@@ -60,6 +60,10 @@
 #pragma comment(linker, "/OPT:NOWIN98")
+#ifndef WINGDIAPI
+#define WINGDIAPI
 #elif defined(__OS2__)
 #include <stdlib.h>
diff --git a/src/glu/sgi/libutil/mipmap.c b/src/glu/sgi/libutil/mipmap.c
index 415dfaa..c475c96 100644
--- a/src/glu/sgi/libutil/mipmap.c
+++ b/src/glu/sgi/libutil/mipmap.c
@@ -6631,7 +6631,7 @@ static TexImage3Dproc pTexImage3D = 0;
 #  include <dlfcn.h>
 #  include <sys/types.h>
-#  include <windows.h>
 static void gluTexImage3D( GLenum target, GLint level,

More information about the mesa-commit mailing list