From 19641a9295f5d14919480124575c6727a0ad79cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Fonseca?= Date: Tue, 6 Jan 2009 16:21:47 +0000 Subject: wgl: Ensure public symbols get the proper DLL linkage attributes. --- src/mesa/state_tracker/wgl/SConscript | 3 +- src/mesa/state_tracker/wgl/stw_framebuffer.c | 3 +- src/mesa/state_tracker/wgl/stw_icd.c | 2 +- src/mesa/state_tracker/wgl/stw_icd.h | 2 - src/mesa/state_tracker/wgl/stw_wgl.c | 2 - src/mesa/state_tracker/wgl/stw_wgl.h | 63 ++++++++++++++++++++++ .../wgl/stw_wgl_arbextensionsstring.c | 3 +- .../state_tracker/wgl/stw_wgl_arbpixelformat.c | 2 - src/mesa/state_tracker/wgl/stw_wgl_context.c | 4 +- .../state_tracker/wgl/stw_wgl_getprocaddress.c | 3 +- src/mesa/state_tracker/wgl/stw_wgl_pixelformat.c | 4 +- src/mesa/state_tracker/wgl/stw_wgl_pixelformat.h | 35 ------------ src/mesa/state_tracker/wgl/stw_wgl_swapbuffers.c | 5 +- src/mesa/state_tracker/wgl/stw_winsys.h | 1 + 14 files changed, 74 insertions(+), 58 deletions(-) create mode 100644 src/mesa/state_tracker/wgl/stw_wgl.h delete mode 100644 src/mesa/state_tracker/wgl/stw_wgl_pixelformat.h diff --git a/src/mesa/state_tracker/wgl/SConscript b/src/mesa/state_tracker/wgl/SConscript index cceb8264ea..bb579930f5 100644 --- a/src/mesa/state_tracker/wgl/SConscript +++ b/src/mesa/state_tracker/wgl/SConscript @@ -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', ]) diff --git a/src/mesa/state_tracker/wgl/stw_framebuffer.c b/src/mesa/state_tracker/wgl/stw_framebuffer.c index 57b89eee96..1ecafa451e 100644 --- a/src/mesa/state_tracker/wgl/stw_framebuffer.c +++ b/src/mesa/state_tracker/wgl/stw_framebuffer.c @@ -25,9 +25,8 @@ * **************************************************************************/ -#define _GDI32_ - #include + #include "main/context.h" #include "pipe/p_format.h" #include "state_tracker/st_context.h" diff --git a/src/mesa/state_tracker/wgl/stw_icd.c b/src/mesa/state_tracker/wgl/stw_icd.c index 17bdbd15fa..1dddc24209 100644 --- a/src/mesa/state_tracker/wgl/stw_icd.c +++ b/src/mesa/state_tracker/wgl/stw_icd.c @@ -29,12 +29,12 @@ #include #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 diff --git a/src/mesa/state_tracker/wgl/stw_icd.h b/src/mesa/state_tracker/wgl/stw_icd.h index 7e2edca16e..8e676fb5b7 100644 --- a/src/mesa/state_tracker/wgl/stw_icd.h +++ b/src/mesa/state_tracker/wgl/stw_icd.h @@ -31,9 +31,7 @@ #include - #include "GL/gl.h" -#include "GL/mesa_wgl.h" typedef ULONG DHGLRC; diff --git a/src/mesa/state_tracker/wgl/stw_wgl.c b/src/mesa/state_tracker/wgl/stw_wgl.c index 6cace95745..0528c369fc 100644 --- a/src/mesa/state_tracker/wgl/stw_wgl.c +++ b/src/mesa/state_tracker/wgl/stw_wgl.c @@ -25,8 +25,6 @@ * **************************************************************************/ -#define _GDI32_ - #include #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 index 0000000000..b86cc240f2 --- /dev/null +++ b/src/mesa/state_tracker/wgl/stw_wgl.h @@ -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 + +#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_ */ diff --git a/src/mesa/state_tracker/wgl/stw_wgl_arbextensionsstring.c b/src/mesa/state_tracker/wgl/stw_wgl_arbextensionsstring.c index fe3a3c1daa..04865796ec 100644 --- a/src/mesa/state_tracker/wgl/stw_wgl_arbextensionsstring.c +++ b/src/mesa/state_tracker/wgl/stw_wgl_arbextensionsstring.c @@ -25,9 +25,8 @@ * **************************************************************************/ -#define _GDI32_ - #include + #include "stw_wgl_arbextensionsstring.h" WINGDIAPI const char * APIENTRY diff --git a/src/mesa/state_tracker/wgl/stw_wgl_arbpixelformat.c b/src/mesa/state_tracker/wgl/stw_wgl_arbpixelformat.c index 14a7c5e1e0..344bb15d3c 100644 --- a/src/mesa/state_tracker/wgl/stw_wgl_arbpixelformat.c +++ b/src/mesa/state_tracker/wgl/stw_wgl_arbpixelformat.c @@ -25,8 +25,6 @@ * **************************************************************************/ -#define _GDI32_ - #include #include "pipe/p_compiler.h" diff --git a/src/mesa/state_tracker/wgl/stw_wgl_context.c b/src/mesa/state_tracker/wgl/stw_wgl_context.c index 59b47200be..d087b63507 100644 --- a/src/mesa/state_tracker/wgl/stw_wgl_context.c +++ b/src/mesa/state_tracker/wgl/stw_wgl_context.c @@ -25,8 +25,6 @@ * **************************************************************************/ -#define _GDI32_ - #include #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; diff --git a/src/mesa/state_tracker/wgl/stw_wgl_getprocaddress.c b/src/mesa/state_tracker/wgl/stw_wgl_getprocaddress.c index ec4f1513cb..ec92d2dfce 100644 --- a/src/mesa/state_tracker/wgl/stw_wgl_getprocaddress.c +++ b/src/mesa/state_tracker/wgl/stw_wgl_getprocaddress.c @@ -25,9 +25,8 @@ * **************************************************************************/ -#define _GDI32_ - #include + #include "glapi/glapi.h" #include "stw_wgl_arbextensionsstring.h" #include "stw_wgl_arbpixelformat.h" diff --git a/src/mesa/state_tracker/wgl/stw_wgl_pixelformat.c b/src/mesa/state_tracker/wgl/stw_wgl_pixelformat.c index bfc085093a..7a8a2e22e4 100644 --- a/src/mesa/state_tracker/wgl/stw_wgl_pixelformat.c +++ b/src/mesa/state_tracker/wgl/stw_wgl_pixelformat.c @@ -25,14 +25,12 @@ * **************************************************************************/ -#define _GDI32_ - #include #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 index ee875c7a1d..0000000000 --- a/src/mesa/state_tracker/wgl/stw_wgl_pixelformat.h +++ /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 */ diff --git a/src/mesa/state_tracker/wgl/stw_wgl_swapbuffers.c b/src/mesa/state_tracker/wgl/stw_wgl_swapbuffers.c index a4dffc5fa0..794259123a 100644 --- a/src/mesa/state_tracker/wgl/stw_wgl_swapbuffers.c +++ b/src/mesa/state_tracker/wgl/stw_wgl_swapbuffers.c @@ -25,9 +25,8 @@ * **************************************************************************/ -#define _GDI32_ - #include + #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( diff --git a/src/mesa/state_tracker/wgl/stw_winsys.h b/src/mesa/state_tracker/wgl/stw_winsys.h index 68f1c7b16b..e61f65f70e 100644 --- a/src/mesa/state_tracker/wgl/stw_winsys.h +++ b/src/mesa/state_tracker/wgl/stw_winsys.h @@ -33,6 +33,7 @@ struct pipe_screen; struct pipe_context; struct pipe_winsys; +struct pipe_surface; struct stw_winsys { -- cgit v1.2.3