mirror of
https://github.com/reactos/reactos.git
synced 2024-07-21 11:48:04 +00:00
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 svn path=/trunk/; revision=30526
This commit is contained in:
parent
133a4f5385
commit
90c87db539
|
@ -61,6 +61,8 @@ int STDCALL glEmptyFunc56( long l1, long l2, long l3, long l4, long l5,
|
||||||
|
|
||||||
#if defined(_M_IX86)
|
#if defined(_M_IX86)
|
||||||
# define FOO(x) #x
|
# define FOO(x) #x
|
||||||
|
|
||||||
|
#if __MINGW32__
|
||||||
# define X(func, ret, typeargs, args, icdidx, tebidx, stack) \
|
# define X(func, ret, typeargs, args, icdidx, tebidx, stack) \
|
||||||
__asm__(".align 4" "\n\t" \
|
__asm__(".align 4" "\n\t" \
|
||||||
".globl _"#func"@"#stack "\n\t" \
|
".globl _"#func"@"#stack "\n\t" \
|
||||||
|
@ -68,6 +70,25 @@ __asm__(".align 4" "\n\t" \
|
||||||
" movl %fs:0x18, %eax" "\n\t" \
|
" movl %fs:0x18, %eax" "\n\t" \
|
||||||
" movl 0xbe8(%eax), %eax" "\n\t" \
|
" movl 0xbe8(%eax), %eax" "\n\t" \
|
||||||
" jmp *"FOO((icdidx*4))"(%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
|
GLFUNCS_MACRO
|
||||||
# undef FOO
|
# undef FOO
|
||||||
|
|
|
@ -601,7 +601,7 @@ static DWORD
|
||||||
OPENGL32_RegGetDriverInfo( LPCWSTR driver, GLDRIVERDATA *icd )
|
OPENGL32_RegGetDriverInfo( LPCWSTR driver, GLDRIVERDATA *icd )
|
||||||
{
|
{
|
||||||
HKEY hKey;
|
HKEY hKey;
|
||||||
WCHAR subKey[1024] = OPENGL_DRIVERS_SUBKEY"\\";
|
WCHAR subKey[1024] = OPENGL_DRIVERS_SUBKEY2;
|
||||||
LONG ret;
|
LONG ret;
|
||||||
DWORD type, size;
|
DWORD type, size;
|
||||||
|
|
||||||
|
|
|
@ -23,6 +23,7 @@ extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define OPENGL_DRIVERS_SUBKEY L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\OpenGLDrivers"
|
#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 */
|
/* gl function list */
|
||||||
#include "glfuncs.h"
|
#include "glfuncs.h"
|
||||||
|
@ -42,16 +43,12 @@ extern "C" {
|
||||||
#endif /* !NDEBUG */
|
#endif /* !NDEBUG */
|
||||||
|
|
||||||
/* debug macros */
|
/* debug macros */
|
||||||
#ifdef _MSC_VER
|
|
||||||
inline void DBGPRINT ( ... ) {}
|
|
||||||
#else
|
|
||||||
# ifdef DEBUG_OPENGL32
|
# ifdef DEBUG_OPENGL32
|
||||||
ULONG DbgPrint(PCH Format,...);
|
ULONG DbgPrint(PCH Format,...);
|
||||||
# include <debug.h>
|
# include <debug.h>
|
||||||
# define DBGPRINT( fmt, args... ) \
|
# define DBGPRINT( fmt, args... ) \
|
||||||
DPRINT( "OpenGL32.DLL: %s: "fmt"\n", __FUNCTION__, ##args )
|
DPRINT( "OpenGL32.DLL: %s: "fmt"\n", __FUNCTION__, ##args )
|
||||||
# endif
|
# endif
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef DBGPRINT
|
#ifndef DBGPRINT
|
||||||
# define DBGPRINT( ... ) do {} while (0)
|
# define DBGPRINT( ... ) do {} while (0)
|
||||||
|
|
|
@ -1027,7 +1027,7 @@ rosglMakeCurrent( HDC hdc, HGLRC hglrc )
|
||||||
DBGPRINT( "Info: Calling DrvSetContext!" );
|
DBGPRINT( "Info: Calling DrvSetContext!" );
|
||||||
SetLastError( ERROR_SUCCESS );
|
SetLastError( ERROR_SUCCESS );
|
||||||
icdTable = glrc->icd->DrvSetContext( hdc, glrc->hglrc,
|
icdTable = glrc->icd->DrvSetContext( hdc, glrc->hglrc,
|
||||||
ROSGL_SetContextCallBack );
|
(void *)ROSGL_SetContextCallBack );
|
||||||
if (icdTable == NULL)
|
if (icdTable == NULL)
|
||||||
{
|
{
|
||||||
DBGPRINT( "Error: DrvSetContext failed (%d)\n", GetLastError() );
|
DBGPRINT( "Error: DrvSetContext failed (%d)\n", GetLastError() );
|
||||||
|
|
Loading…
Reference in a new issue