Author: hyperion Date: Fri Aug 7 03:50:19 2009 New Revision: 42448
URL: http://svn.reactos.org/svn/reactos?rev=42448&view=rev Log: modified dll/win32/opengl32/gl.c modified dll/win32/opengl32/opengl32.c Give prototypes to all functions Implement OpenGL thunks in assembler for Visual C++ Nope, environment is not compiler this time, either
modified dll/win32/opengl32/opengl32.h Don't use dllexport, we have a spec file
Congratulations opengl32, you now build with Visual C++
Modified: trunk/reactos/dll/win32/opengl32/gl.c trunk/reactos/dll/win32/opengl32/opengl32.c trunk/reactos/dll/win32/opengl32/opengl32.h
Modified: trunk/reactos/dll/win32/opengl32/gl.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/opengl32/gl.c?rev... ============================================================================== --- trunk/reactos/dll/win32/opengl32/gl.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/opengl32/gl.c [iso-8859-1] Fri Aug 7 03:50:19 2009 @@ -19,12 +19,12 @@ * * On other machines we use C to forward the calls (slow...) */ - + #include "opengl32.h"
C_ASSERT(FIELD_OFFSET(TEB, glTable) == 0xbe8);
-int WINAPI glEmptyFunc0() { return 0; } +int WINAPI glEmptyFunc0( void ) { return 0; } int WINAPI glEmptyFunc4( long l1 ) { return 0; } int WINAPI glEmptyFunc8( long l1, long l2 ) { return 0; } int WINAPI glEmptyFunc12( long l1, long l2, long l3 ) { return 0; } @@ -59,7 +59,7 @@ #if defined(_M_IX86) # define FOO(x) #x
-#if __MINGW32__ +#ifdef __GNUC__ # define X(func, ret, typeargs, args, icdidx, tebidx, stack) \ __asm__(".align 4" "\n\t" \ ".globl _"#func"@"#stack "\n\t" \ @@ -67,6 +67,14 @@ " movl %fs:0x18, %eax" "\n\t" \ " movl 0xbe8(%eax), %eax" "\n\t" \ " jmp *"FOO((icdidx*4))"(%eax)" "\n\t"); +#elif defined(_MSC_VER) +# define X(func, ret, typeargs, args, icdidx, tebidx, stack) \ +__declspec(naked) ret WINAPI func typeargs \ +{ \ + __asm { mov eax, dword ptr fs:[18h] }; \ + __asm { mov eax, dword ptr [eax+0be8h] }; \ + __asm { jmp dword ptr [eax+icdidx*4] }; \ +} #else # define X(func, ret, typeargs, args, icdidx, tebidx, stack) \ ret WINAPI func typeargs \
Modified: trunk/reactos/dll/win32/opengl32/opengl32.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/opengl32/opengl32... ============================================================================== --- trunk/reactos/dll/win32/opengl32/opengl32.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/opengl32/opengl32.c [iso-8859-1] Fri Aug 7 03:50:19 2009 @@ -26,7 +26,7 @@
static BOOL -OPENGL32_ThreadAttach() +OPENGL32_ThreadAttach( void ) { GLTHREADDATA* lpData = NULL; PROC *dispatchTable = NULL; @@ -69,7 +69,7 @@
static void -OPENGL32_ThreadDetach() +OPENGL32_ThreadDetach( void ) { GLTHREADDATA* lpData = NULL; PROC *dispatchTable = NULL; @@ -96,7 +96,7 @@
static BOOL -OPENGL32_ProcessAttach() +OPENGL32_ProcessAttach( void ) { SECURITY_ATTRIBUTES attrib = { sizeof (SECURITY_ATTRIBUTES), /* nLength */ NULL, /* lpSecurityDescriptor */ @@ -136,7 +136,7 @@
static void -OPENGL32_ProcessDetach() +OPENGL32_ProcessDetach( void ) { GLDRIVERDATA *icd, *icd2; GLDCDATA *dcdata, *dcdata2;
Modified: trunk/reactos/dll/win32/opengl32/opengl32.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/opengl32/opengl32... ============================================================================== --- trunk/reactos/dll/win32/opengl32/opengl32.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/opengl32/opengl32.h [iso-8859-1] Fri Aug 7 03:50:19 2009 @@ -103,7 +103,7 @@ #ifdef APIENTRY #undef APIENTRY #endif /* APIENTRY */ -#define APIENTRY EXPORT __stdcall +#define APIENTRY __stdcall
/* Called by the driver to set the dispatch table */ typedef DWORD (WINAPI *SetContextCallBack)( const ICDTable * ); @@ -192,7 +192,7 @@ BOOL APIENTRY rosglMakeCurrent( HDC hdc, HGLRC hglrc );
/* empty gl functions from gl.c */ -int WINAPI glEmptyFunc0(); +int WINAPI glEmptyFunc0( void ); int WINAPI glEmptyFunc4( long ); int WINAPI glEmptyFunc8( long, long ); int WINAPI glEmptyFunc12( long, long, long ); @@ -216,7 +216,7 @@
#ifdef OPENGL32_GL_FUNC_PROTOTYPES
-#define X(func,ret,typeargs,args,icdidx,tebidx,stack) EXPORT ret WINAPI func typeargs; +#define X(func,ret,typeargs,args,icdidx,tebidx,stack) ret WINAPI func typeargs; GLFUNCS_MACRO #undef X