aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/Makefile5
-rw-r--r--test/layered.c6
-rw-r--r--wglarb.c23
3 files changed, 18 insertions, 16 deletions
diff --git a/test/Makefile b/test/Makefile
index 8c2092a..2b5a0b7 100644
--- a/test/Makefile
+++ b/test/Makefile
@@ -1,5 +1,5 @@
TARGET64=x86_64-w64-mingw32
-TARGET32=mingw32
+TARGET32=i686-w64-mingw32
CC64=-$(TARGET64)-gcc
CC32=-$(TARGET32)-gcc
CFLAGS=-static-libgcc -static-libstdc++ -I..
@@ -25,7 +25,6 @@ layered64_rc.o: layered.rc manifest.xml
layered32_rc.o: layered.rc manifest.xml
$(WINDRES32) --input layered.rc --output layered32_rc.o
-
shared64.exe: shared.c shared64_rc.o ../wglarb.c
$(CC64) $(CFLAGS) -o shared64.exe shared.c shared64_rc.o ../wglarb.c $(LIBS) -Wl,--subsystem,windows
@@ -39,3 +38,5 @@ shared64_rc.o: layered.rc manifest.xml
shared32_rc.o: layered.rc manifest.xml
$(WINDRES32) --input shared.rc --output shared32_rc.o
+clean:
+ rm *.o *.exe
diff --git a/test/layered.c b/test/layered.c
index 80f25cf..f28c677 100644
--- a/test/layered.c
+++ b/test/layered.c
@@ -304,12 +304,10 @@ int main(int argc, char *argv[])
if( 6 <= os_vinfo.dwMajorVersion ) {
hDwmAPI_DLL = LoadLibrary("dwmapi.dll");
if( hDwmAPI_DLL ) {
- impl_DwmEnableBlurBehindWindow =
- (procp_DwmEnableBlurBehindWindow)
+ *(PROC*)(&impl_DwmEnableBlurBehindWindow) =
GetProcAddress(hDwmAPI_DLL, "DwmEnableBlurBehindWindow");
- impl_DwmExtendFrameIntoClientArea =
- (procp_DwmExtendFrameIntoClientArea)
+ *(PROC*)(&impl_DwmExtendFrameIntoClientArea) =
GetProcAddress(hDwmAPI_DLL, "DwmExtendFrameIntoClientArea");
}
}
diff --git a/wglarb.c b/wglarb.c
index ba543d6..a8bc126 100644
--- a/wglarb.c
+++ b/wglarb.c
@@ -33,7 +33,9 @@ static DWORD wglarb_intermediary_lock(void)
if( !wglarb_intermediary_mutex ) {
/* Between testing for the validity of the mutex handle,
* creating a new mutex handle and using the interlocked
- * exchange there is a race. */
+ * exchange there is a race... */
+
+ /* //// START \\\\ */
HANDLE const new_mutex =
CreateMutex(NULL, TRUE, NULL);
@@ -44,6 +46,8 @@ static DWORD wglarb_intermediary_lock(void)
new_mutex,
NULL );
+ /* //// FINISH \\\\ */
+
if( dst_mutex ) {
/* In this case we lost the race and another thread
* beat this thread in creating a mutex object.
@@ -85,7 +89,6 @@ static BOOL wglarb_intermediary_create_Wnd(void)
wc.lpszClassName = WGLARB_INTERMEDIARY_CLASS;
RegisterClass(&wc);
- /* Create a temporaray context to get address of wgl extensions. */
wglarb_intermediary_hWnd =
CreateWindowEx(
WGLARB_INTERMEDIARY_EXSTYLE,
@@ -95,7 +98,7 @@ static BOOL wglarb_intermediary_create_Wnd(void)
0,0,0,0,
NULL,NULL,
hInstance,
- NULL);
+ NULL );
if( !wglarb_intermediary_hWnd ) {
FALSE;
@@ -160,7 +163,7 @@ static BOOL wglarb_intermediary_makecurrent(HDC *hOrigDC, HGLRC *hOrigRC)
*hOrigRC = wglGetCurrentContext();
if( !wglarb_intermediary_hRC
- && !wglarb_intermediary_create_RC() ) {
+ && !wglarb_intermediary_create_RC() ) {
return FALSE;
}
@@ -184,8 +187,8 @@ HGLRC WINAPI wglarb_CreateContextAttribsARB(
}
PFNWGLCREATECONTEXTATTRIBSARBPROC impl =
- (PFNWGLCREATECONTEXTATTRIBSARBPROC) wglGetProcAddress(
- "wglCreateContextAttribsARB");
+ (PFNWGLCREATECONTEXTATTRIBSARBPROC)
+ wglGetProcAddress("wglCreateContextAttribsARB");
HGLRC ret = NULL;
if( impl ) {
@@ -218,13 +221,13 @@ BOOL WINAPI wglarb_ChoosePixelFormatARB(
PFNWGLCHOOSEPIXELFORMATARBPROC impl = NULL;
- impl = (PFNWGLCHOOSEPIXELFORMATARBPROC) wglGetProcAddress(
- "wglChoosePixelFormatARB");
+ impl = (PFNWGLCHOOSEPIXELFORMATARBPROC)
+ wglGetProcAddress("wglChoosePixelFormatARB");
if( !impl ) {
/* WGL_EXT_pixel_format uses the same function prototypes
* as the WGL_ARB_pixel_format extension */
- impl = (PFNWGLCHOOSEPIXELFORMATARBPROC) wglGetProcAddress(
- "wglChoosePixelFormatEXT");
+ impl = (PFNWGLCHOOSEPIXELFORMATARBPROC)
+ wglGetProcAddress("wglChoosePixelFormatEXT");
}
BOOL ret = FALSE;