diff options
| author | Pietro Gagliardi <[email protected]> | 2014-07-17 19:36:24 -0400 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2014-07-17 19:36:24 -0400 |
| commit | 0adac4d3ca1ec91e6364fe11276323803418c2ff (patch) | |
| tree | 5160d2aa05131638ff2f4662627cb967c3b5407b /redo/common_windows.go | |
| parent | 257fd8f07c821a9dd1f879e94c703cbbb9a2c764 (diff) | |
Began the drudgery of converting all the Windows code to use cgo, because I'm not going to wait to debug this smashed stack.
Diffstat (limited to 'redo/common_windows.go')
| -rw-r--r-- | redo/common_windows.go | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/redo/common_windows.go b/redo/common_windows.go index 30c0d75..b1fa0ee 100644 --- a/redo/common_windows.go +++ b/redo/common_windows.go @@ -8,8 +8,18 @@ import ( "unsafe" ) -// TODO get rid of this when we actually use s_POINT somewhere -var dummyToFoolwinconstgen s_POINT +// #include "winapi_windows.h" +import "C" + +//export xpanic +func xpanic(msg *C.char, lasterr C.DWORD) { + panic(fmt.Errorf("%s: %s", C.GoString(msg), syscall.Errno(lasterr)) +} + +//export xmissedmsg +func xmissedmsg(purpose *C.char, f *C.char, uMsg C.UINT) { + panic(fmt.Errorf("%s window procedure message %d does not return a value (bug in %s)", C.GoString(purpose), uMsg, C.GoString(f))) +} func getWindowText(hwnd uintptr) string { // WM_GETTEXTLENGTH and WM_GETTEXT return the count /without/ the terminating null character |
