it seems that runtime api change I finally successfully compile
crutches, and examples now works just fine, please see the patch below
(apply the patch crutches folder):
diff --git a/crutches/crutch.c b/crutches/crutch.c
index 7d6b8b0..f6aa4bc 100644
--- a/crutches/crutch.c
+++ b/crutches/crutch.c
@@ -5,7 +5,7 @@
#include "crutch.h"
uintptr crutches·stdcall_return(uintptr retval, void*
addr_of_caller_first_arg, uint32 no_of_caller_args);
-
+void *user32;
void *DefDlgProcW;
void *GetClassInfoExW;
void *LoadCursorW;
@@ -18,13 +18,14 @@ void
·initcrutch(void) {
// TODO: make sure that 'runtime·osinit()' was already called,
// or use their approach with 'get_proc_addr2()'
- DefDlgProcW = runtime·get_proc_addr("user32.dll", "DefDlgProcW");
- GetClassInfoExW = runtime·get_proc_addr("user32.dll",
"GetClassInfoExW");
- LoadCursorW = runtime·get_proc_addr("user32.dll", "LoadCursorW");
- LoadIconW = runtime·get_proc_addr("user32.dll", "LoadIconW");
- PostMessageW = runtime·get_proc_addr("user32.dll",
"PostMessageW");
- RegisterClassExW = runtime·get_proc_addr("user32.dll",
"RegisterClassExW");
- RegisterWindowMessageW = runtime·get_proc_addr("user32.dll",
"RegisterWindowMessageW");
+ user32 = runtime·stdcall(runtime·LoadLibraryEx, 3, "user32.dll",
0, 0);
+ DefDlgProcW = runtime·stdcall(runtime·GetProcAddress, 2, user32,
"DefDlgProcW");
+ GetClassInfoExW = runtime·stdcall(runtime·GetProcAddress, 2,
user32, "GetClassInfoExW");
+ LoadCursorW = runtime·stdcall(runtime·GetProcAddress, 2, user32,
"LoadCursorW");
+ LoadIconW = runtime·stdcall(runtime·GetProcAddress, 2, user32,
"LoadIconW");
+ PostMessageW = runtime·stdcall(runtime·GetProcAddress, 2, user32,
"PostMessageW");
+ RegisterClassExW = runtime·stdcall(runtime·GetProcAddress, 2,
user32, "RegisterClassExW");
+ RegisterWindowMessageW = runtime·stdcall(runtime·GetProcAddress,
2, user32, "RegisterWindowMessageW");
}
enum {
diff --git a/crutches/crutch.h b/crutches/crutch.h
diff --git a/crutches/queue.c b/crutches/queue.c
index b12fe64..808b96f 100644
--- a/crutches/queue.c
+++ b/crutches/queue.c
@@ -11,7 +11,7 @@ void*
crutches·wildcall(void* fn, int32 count, ...) {
return crutches·wildcall_raw(fn, count, (uintptr*)(&count+1));
}
-
+static void* kernel32;
static void* InitializeCriticalSectionAndSpinCount;
static void* EnterCriticalSection;
static void* LeaveCriticalSection;
@@ -121,12 +121,13 @@ void
·initqueue(void) {
// TODO: make sure that 'runtime·osinit()' was already called,
// or use their approach with 'get_proc_addr2()'
- InitializeCriticalSectionAndSpinCount =
runtime·get_proc_addr("kernel32.dll",
"InitializeCriticalSectionAndSpinCount");
- EnterCriticalSection = runtime·get_proc_addr("kernel32.dll",
"EnterCriticalSection");
- LeaveCriticalSection = runtime·get_proc_addr("kernel32.dll",
"LeaveCriticalSection");
- CreateEvent = runtime·get_proc_addr("kernel32.dll",
"CreateEventA");
- WaitForSingleObject = runtime·get_proc_addr("kernel32.dll",
"WaitForSingleObject");
- SetEvent = runtime·get_proc_addr("kernel32.dll", "SetEvent");
+ kernel32 = runtime·stdcall(runtime·LoadLibraryEx, 3,
"kernel32.dll", 0, 0);
+ InitializeCriticalSectionAndSpinCount =
runtime·stdcall(runtime·GetProcAddress, 2, kernel32,
"InitializeCriticalSectionAndSpinCount");
+ EnterCriticalSection = runtime·stdcall(runtime·GetProcAddress, 2,
kernel32, "EnterCriticalSection");
+ LeaveCriticalSection = runtime·stdcall(runtime·GetProcAddress, 2,
kernel32, "LeaveCriticalSection");
+ CreateEvent = runtime·stdcall(runtime·GetProcAddress, 2,
kernel32, "CreateEventA");
+ WaitForSingleObject = runtime·stdcall(runtime·GetProcAddress, 2,
kernel32, "WaitForSingleObject");
+ SetEvent = runtime·stdcall(runtime·GetProcAddress, 2, kernel32,
"SetEvent");
crutches·newqueue(&crutches·queue, qqdata, qqmaxsize);
}
thanks for help
cheers
laurent