wgl: Ensure public symbols get the proper DLL linkage attributes.
authorJosé Fonseca <jfonseca@vmware.com>
Tue, 6 Jan 2009 16:21:47 +0000 (16:21 +0000)
committerJosé Fonseca <jfonseca@vmware.com>
Tue, 6 Jan 2009 18:23:16 +0000 (18:23 +0000)
14 files changed:
src/mesa/state_tracker/wgl/SConscript
src/mesa/state_tracker/wgl/stw_framebuffer.c
src/mesa/state_tracker/wgl/stw_icd.c
src/mesa/state_tracker/wgl/stw_icd.h
src/mesa/state_tracker/wgl/stw_wgl.c
src/mesa/state_tracker/wgl/stw_wgl.h [new file with mode: 0644]
src/mesa/state_tracker/wgl/stw_wgl_arbextensionsstring.c
src/mesa/state_tracker/wgl/stw_wgl_arbpixelformat.c
src/mesa/state_tracker/wgl/stw_wgl_context.c
src/mesa/state_tracker/wgl/stw_wgl_getprocaddress.c
src/mesa/state_tracker/wgl/stw_wgl_pixelformat.c
src/mesa/state_tracker/wgl/stw_wgl_pixelformat.h [deleted file]
src/mesa/state_tracker/wgl/stw_wgl_swapbuffers.c
src/mesa/state_tracker/wgl/stw_winsys.h

index cceb8264eada3f5956acae111065e3b611bddfe5..bb579930f52a870ed50214282672bdf5a9b47733 100644 (file)
@@ -11,8 +11,9 @@ if env['platform'] in ['windows']:
     ])
      
     env.Append(CPPDEFINES = [
+        '_GDI32_', # prevent wgl* being declared __declspec(dllimport)
+        'BUILD_GL32', # declare gl* as __declspec(dllexport) in Mesa headers 
         '__GL_EXPORTS',
-        'BUILD_GL32',
         '_GNU_H_WINDOWS32_DEFINES',
     ])
      
index 57b89eee9668b423c6718ef0669768f98fedf1a8..1ecafa451ee8b825d5a6f14884cb2ca5dac8ef91 100644 (file)
@@ -25,9 +25,8 @@
  * 
  **************************************************************************/
 
-#define _GDI32_
-
 #include <windows.h>
+
 #include "main/context.h"
 #include "pipe/p_format.h"
 #include "state_tracker/st_context.h"
index 17bdbd15faccb5f89084b405b923da840fcba475..1dddc2420976474c32292ede21076339525ed210 100644 (file)
 #include <stdio.h>
 
 #include "GL/gl.h"
-#include "GL/mesa_wgl.h"
 
 #include "pipe/p_debug.h"
 
 #include "stw_device.h"
 #include "stw_icd.h"
+#include "stw_wgl.h"
 
 
 static HGLRC
index 7e2edca16ece7119d5528b813673afb72e91fd89..8e676fb5b74085465f4e82fb0dfb3f7cd1c669bd 100644 (file)
@@ -31,9 +31,7 @@
 
 #include <windows.h>
 
-
 #include "GL/gl.h"
-#include "GL/mesa_wgl.h"
 
 
 typedef ULONG DHGLRC;
index 6cace9574587cccb375e314a202c9b491df19a09..0528c369fc8c67d473deac53bb42668c88fcc984 100644 (file)
@@ -25,8 +25,6 @@
  *
  **************************************************************************/
 
-#define _GDI32_
-
 #include <windows.h>
 
 #include "pipe/p_debug.h"
diff --git a/src/mesa/state_tracker/wgl/stw_wgl.h b/src/mesa/state_tracker/wgl/stw_wgl.h
new file mode 100644 (file)
index 0000000..b86cc24
--- /dev/null
@@ -0,0 +1,63 @@
+/**************************************************************************
+ *
+ * Copyright 2009 VMware, Inc.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+#ifndef STW_WGL_H_
+#define STW_WGL_H_
+
+
+#include <windows.h>
+
+#include "GL/gl.h"
+
+
+/*
+ * Undeclared APIs exported by opengl32.dll
+ */
+
+WINGDIAPI BOOL WINAPI
+wglSwapBuffers(HDC hdc);
+
+WINGDIAPI int WINAPI
+wglChoosePixelFormat(HDC hdc,
+                     CONST PIXELFORMATDESCRIPTOR *ppfd);
+
+WINGDIAPI int WINAPI
+wglDescribePixelFormat(HDC hdc,
+                       int iPixelFormat,
+                       UINT nBytes,
+                       LPPIXELFORMATDESCRIPTOR ppfd);
+
+WINGDIAPI int WINAPI
+wglGetPixelFormat(HDC hdc);
+
+WINGDIAPI BOOL WINAPI
+wglSetPixelFormat(HDC hdc,
+                  int iPixelFormat,
+                  CONST PIXELFORMATDESCRIPTOR *ppfd);
+
+
+#endif /* STW_WGL_H_ */
index fe3a3c1daa9bfe2dfe10973973a4915ab96cfca6..04865796ec8db5b5a9b62911444dd6353577a3ab 100644 (file)
@@ -25,9 +25,8 @@
  * 
  **************************************************************************/
 
-#define _GDI32_
-
 #include <windows.h>
+
 #include "stw_wgl_arbextensionsstring.h"
 
 WINGDIAPI const char * APIENTRY
index 14a7c5e1e063a5434fb415bdb2d564086cae3e93..344bb15d3c169d39438ccc3c3af568da0e4f1689 100644 (file)
@@ -25,8 +25,6 @@
  *
  **************************************************************************/
 
-#define _GDI32_
-
 #include <windows.h>
 
 #include "pipe/p_compiler.h"
index 59b47200be40d7b39a8a1dc26867c98789e1df45..d087b63507c08ee258527e4935ec5b9fb0ab32d8 100644 (file)
@@ -25,8 +25,6 @@
  *
  **************************************************************************/
 
-#define _GDI32_
-
 #include <windows.h>
 
 #include "main/mtypes.h"
@@ -41,7 +39,7 @@
 #include "stw_pixelformat.h"
 #include "stw_wgl_arbmultisample.h"
 #include "stw_wgl_context.h"
-#include "stw_wgl_pixelformat.h"
+#include "stw_wgl.h"
 
 static struct wgl_context *ctx_head = NULL;
 
index ec4f1513cb8adf37334d58bb431c17b51f02ae85..ec92d2dfce228fb0c7d74e611f2be225ed5059d6 100644 (file)
@@ -25,9 +25,8 @@
  *
  **************************************************************************/
 
-#define _GDI32_
-
 #include <windows.h>
+
 #include "glapi/glapi.h"
 #include "stw_wgl_arbextensionsstring.h"
 #include "stw_wgl_arbpixelformat.h"
index bfc085093a8979d676e31d66bb31d23e4cc253d5..7a8a2e22e49447895f018b28ad43492431844cac 100644 (file)
  *
  **************************************************************************/
 
-#define _GDI32_
-
 #include <windows.h>
 
 #include "pipe/p_compiler.h"
 #include "pipe/p_debug.h"
 #include "stw_pixelformat.h"
-#include "stw_wgl_pixelformat.h"
+#include "stw_wgl.h"
 
 static uint currentpixelformat = 0;
 
diff --git a/src/mesa/state_tracker/wgl/stw_wgl_pixelformat.h b/src/mesa/state_tracker/wgl/stw_wgl_pixelformat.h
deleted file mode 100644 (file)
index ee875c7..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-/**************************************************************************
- * 
- * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- * 
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- * 
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- * 
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- * 
- **************************************************************************/
-
-#ifndef WGL_PIXELFORMAT_H
-#define WGL_PIXELFORMAT_H
-
-WINGDIAPI int APIENTRY
-wglGetPixelFormat(
-   HDC hdc );
-
-#endif /* WGL_PIXELFORMAT_H */
index a4dffc5fa0ef7d1b83fcf496e0e42014f3478f85..794259123a172e8ddb0f8b1cc335f86a78e8ea1b 100644 (file)
@@ -25,9 +25,8 @@
  *
  **************************************************************************/
 
-#define _GDI32_
-
 #include <windows.h>
+
 #include "pipe/p_winsys.h"
 #include "pipe/p_screen.h"
 #include "pipe/p_context.h"
@@ -36,7 +35,7 @@
 #include "stw_winsys.h"
 #include "stw_device.h"
 #include "stw_framebuffer.h"
-#include "stw_wgl_context.h"
+#include "stw_wgl.h"
 
 WINGDIAPI BOOL APIENTRY
 wglSwapBuffers(
index 68f1c7b16b78d6adee4ea9a6d084cbcee27b5093..e61f65f70e155e0c45019bf764f4421086c97902 100644 (file)
@@ -33,6 +33,7 @@
 struct pipe_screen;
 struct pipe_context;
 struct pipe_winsys;
+struct pipe_surface;
 
 struct stw_winsys
 {