From: Alan Third Date: Tue, 23 May 2017 09:42:20 +0000 (-0700) Subject: Fix GNUstep build X-Git-Tag: emacs-26.0.90~521^2~301 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=4a485410ce74cafd4e9c344e31f7575464a16113;p=emacs.git Fix GNUstep build * src/nsterm.h [NS_IMPL_GNUSTEP]: Add typedefs for Cocoa-only types. (NSWindowStyleMaskUtilityWindow): #define to NSUtilityWindowMask in GNUstep and old versions of macOS. * src/nsfns.m (ns-set-mouse-absolute-pixel-position): Function only works in cocoa, not GNUstep. --- diff --git a/src/nsfns.m b/src/nsfns.m index 00310c051ff..3833ee75ac2 100644 --- a/src/nsfns.m +++ b/src/nsfns.m @@ -3046,6 +3046,9 @@ The coordinates X and Y are interpreted in pixels relative to a position \(0, 0) of the selected frame's display. */) (Lisp_Object x, Lisp_Object y) { +#ifdef NS_IMPL_COCOA + /* GNUstep doesn't support CGWarpMouseCursorPosition, so none of + this will work. */ struct frame *f = SELECTED_FRAME (); EmacsView *view = FRAME_NS_VIEW (f); NSScreen *screen = [[view window] screen]; @@ -3072,6 +3075,7 @@ The coordinates X and Y are interpreted in pixels relative to a position CGPoint mouse_pos = CGPointMake(mouse_x, mouse_y); CGWarpMouseCursorPosition (mouse_pos); +#endif /* NS_IMPL_COCOA */ return Qnil; } diff --git a/src/nsterm.h b/src/nsterm.h index 5da949e1fb1..443a40ed6f5 100644 --- a/src/nsterm.h +++ b/src/nsterm.h @@ -62,6 +62,13 @@ typedef CGFloat EmacsCGFloat; typedef float EmacsCGFloat; #endif +/* FIXME: It looks as though instancetype will be supported in GNUstep + at some point, but I'm not sure what version. */ +#ifdef NS_IMPL_GNUSTEP +typedef id instancetype; +typedef int NSWindowStyleMask; +#endif + /* ========================================================================== Trace support @@ -1290,6 +1297,7 @@ extern char gnustep_base_version[]; /* version tracking */ #define NSWindowStyleMaskMiniaturizable NSMiniaturizableWindowMask #define NSWindowStyleMaskResizable NSResizableWindowMask #define NSWindowStyleMaskTitled NSTitledWindowMask +#define NSWindowStyleMaskUtilityWindow NSUtilityWindowMask #define NSAlertStyleCritical NSCriticalAlertStyle #define NSControlSizeRegular NSRegularControlSize #endif