[ros-diffs] [greatlrd] 30526: Fix a WCHAR issue in opengl32 one char was not in wchar format. discover it by compiling with VS Use the C version of GLFUNCS_MACRO for VS and only use the inline assembler version if it _MINGW32_ set Fix few warnings for VS

greatlrd at svn.reactos.org greatlrd at svn.reactos.org
Sat Nov 17 21:22:45 CET 2007


Author: greatlrd
Date: Sat Nov 17 23:22:45 2007
New Revision: 30526

URL: http://svn.reactos.org/svn/reactos?rev=30526&view=rev
Log:
Fix a WCHAR issue in opengl32 one char was not in wchar format. discover it by compiling with VS 
Use the C version of GLFUNCS_MACRO for VS and only use the inline assembler version if it _MINGW32_ set
Fix few warnings for VS


Modified:
    trunk/reactos/dll/win32/opengl32/gl.c
    trunk/reactos/dll/win32/opengl32/opengl32.c
    trunk/reactos/dll/win32/opengl32/opengl32.h
    trunk/reactos/dll/win32/opengl32/wgl.c

Modified: trunk/reactos/dll/win32/opengl32/gl.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/opengl32/gl.c?rev=30526&r1=30525&r2=30526&view=diff
==============================================================================
--- trunk/reactos/dll/win32/opengl32/gl.c (original)
+++ trunk/reactos/dll/win32/opengl32/gl.c Sat Nov 17 23:22:45 2007
@@ -61,6 +61,8 @@
 
 #if defined(_M_IX86)
 # define FOO(x) #x
+
+#if __MINGW32__
 # define X(func, ret, typeargs, args, icdidx, tebidx, stack)          \
 __asm__(".align 4"                                    "\n\t"          \
         ".globl _"#func"@"#stack                      "\n\t"          \
@@ -68,6 +70,25 @@
         "       movl %fs:0x18, %eax"                  "\n\t"          \
         "       movl 0xbe8(%eax), %eax"               "\n\t"          \
         "       jmp *"FOO((icdidx*4))"(%eax)"         "\n\t");
+#else
+# define X(func, ret, typeargs, args, icdidx, tebidx, stack)          \
+ret STDCALL func typeargs                                             \
+{                                                                     \
+	PROC *table;                                                  \
+	PROC fn;                                                      \
+	if (tebidx >= 0 && 0)                                         \
+	{                                                             \
+		table = (PROC *)NtCurrentTeb()->glDispatchTable;      \
+		fn = table[tebidx];                                   \
+	}                                                             \
+	else                                                          \
+	{                                                             \
+		table = (PROC *)NtCurrentTeb()->glTable;              \
+		fn = table[icdidx];                                   \
+	}                                                             \
+	return (ret)((ret(*)typeargs)fn)args;                         \
+}
+#endif
 
 GLFUNCS_MACRO
 # undef FOO

Modified: trunk/reactos/dll/win32/opengl32/opengl32.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/opengl32/opengl32.c?rev=30526&r1=30525&r2=30526&view=diff
==============================================================================
--- trunk/reactos/dll/win32/opengl32/opengl32.c (original)
+++ trunk/reactos/dll/win32/opengl32/opengl32.c Sat Nov 17 23:22:45 2007
@@ -601,7 +601,7 @@
 OPENGL32_RegGetDriverInfo( LPCWSTR driver, GLDRIVERDATA *icd )
 {
 	HKEY hKey;
-	WCHAR subKey[1024] = OPENGL_DRIVERS_SUBKEY"\\";
+	WCHAR subKey[1024] = OPENGL_DRIVERS_SUBKEY2;
 	LONG ret;
 	DWORD type, size;
 

Modified: trunk/reactos/dll/win32/opengl32/opengl32.h
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/opengl32/opengl32.h?rev=30526&r1=30525&r2=30526&view=diff
==============================================================================
--- trunk/reactos/dll/win32/opengl32/opengl32.h (original)
+++ trunk/reactos/dll/win32/opengl32/opengl32.h Sat Nov 17 23:22:45 2007
@@ -23,6 +23,7 @@
 #endif
 
 #define OPENGL_DRIVERS_SUBKEY L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\OpenGLDrivers"
+#define OPENGL_DRIVERS_SUBKEY2 L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\OpenGLDrivers\\"
 
 /* gl function list */
 #include "glfuncs.h"
@@ -42,16 +43,12 @@
 #endif /* !NDEBUG */
 
 /* debug macros */
-#ifdef _MSC_VER
-inline void DBGPRINT ( ... ) {}
-#else
 # ifdef DEBUG_OPENGL32
 ULONG DbgPrint(PCH Format,...);
 #  include <debug.h>
 #  define DBGPRINT( fmt, args... ) \
           DPRINT( "OpenGL32.DLL: %s: "fmt"\n", __FUNCTION__, ##args )
 # endif
-#endif
 
 #ifndef DBGPRINT
 # define DBGPRINT( ... ) do {} while (0)

Modified: trunk/reactos/dll/win32/opengl32/wgl.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/opengl32/wgl.c?rev=30526&r1=30525&r2=30526&view=diff
==============================================================================
--- trunk/reactos/dll/win32/opengl32/wgl.c (original)
+++ trunk/reactos/dll/win32/opengl32/wgl.c Sat Nov 17 23:22:45 2007
@@ -1027,7 +1027,7 @@
 			DBGPRINT( "Info: Calling DrvSetContext!" );
 			SetLastError( ERROR_SUCCESS );
 			icdTable = glrc->icd->DrvSetContext( hdc, glrc->hglrc,
-			                                     ROSGL_SetContextCallBack );
+			                                     (void *)ROSGL_SetContextCallBack );
 			if (icdTable == NULL)
 			{
 				DBGPRINT( "Error: DrvSetContext failed (%d)\n", GetLastError() );




More information about the Ros-diffs mailing list