diff --git a/base/os.h b/base/os.h index 5d08c4f..5957fc3 100644 --- a/base/os.h +++ b/base/os.h @@ -60,4 +60,12 @@ #endif #endif +#ifdef RobotGo_64 + typedef int64_t intptr; + typedef uint64_t uintptr; +#else + typedef int32_t intptr; + typedef uint32_t uintptr; // Unsigned pointer integer +#endif + #endif /* OS_H */ diff --git a/robotgo_x11.go b/robotgo_x11.go index 524a24e..8ef4eae 100644 --- a/robotgo_x11.go +++ b/robotgo_x11.go @@ -15,6 +15,7 @@ package robotgo import ( "errors" + "fmt" "log" "github.com/robotn/xgb" @@ -185,11 +186,11 @@ func Alert(title, msg string, args ...string) bool { ` -title ` + title + ` -buttons ` + defaultBtn + ":0," + cancelBtn + ":1" + ` -default Ok` out, err := Run(c) if err != nil { - fmt.Println("Alert: ", err, ". ", strint(out)) + fmt.Println("Alert: ", err, ". ", string(out)) return false } - if strint(out) == "1" { + if string(out) == "1" { return false } return true diff --git a/screen/screengrab_c.h b/screen/screengrab_c.h index 7464c8d..72f8203 100644 --- a/screen/screengrab_c.h +++ b/screen/screengrab_c.h @@ -95,7 +95,7 @@ MMBitmapRef copyMMBitmapFromDisplayInRect(MMRectInt32 rect, int32_t display_id) if (display_id == -1) { screen = GetDC(NULL); /* Get entire screen */ } else { - screen = GetDC((HWND) display_id); + screen = GetDC((HWND) (uintptr) display_id); } if (screen == NULL) { return NULL; } diff --git a/window/pub.h b/window/pub.h index bf7b8fd..4f0766e 100644 --- a/window/pub.h +++ b/window/pub.h @@ -15,14 +15,6 @@ #include #endif -#ifdef RobotGo_64 - typedef int64_t intptr; - typedef uint64_t uintptr; -#else - typedef int32_t intptr; - typedef uint32_t uintptr; // Unsigned pointer integer -#endif - struct _MData{ #if defined(IS_MACOSX) CGWindowID CgID; // Handle to a CGWindowID