unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Alan Third <alan@idiocy.org>
To: Paul Eggert <eggert@cs.ucla.edu>
Cc: Philipp Stephani <p.stephani2@gmail.com>,
	Anders Lindgren <andlind@gmail.com>,
	emacs-devel@gnu.org
Subject: [PATCH] Fix GNUstep build
Date: Mon, 22 May 2017 20:21:03 +0100	[thread overview]
Message-ID: <20170522192103.GA50892@breton.holly.idiocy.org> (raw)
In-Reply-To: <16003c01-1b84-677d-51c3-12646503cb59@cs.ucla.edu>

* 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.
---
 src/nsfns.m  | 4 ++++
 src/nsterm.h | 8 ++++++++
 2 files changed, 12 insertions(+)

diff --git a/src/nsfns.m b/src/nsfns.m
index 00310c051f..3833ee75ac 100644
--- a/src/nsfns.m
+++ b/src/nsfns.m
@@ -3046,6 +3046,9 @@ value is a list of the form (LEFT, TOP, RIGHT, BOTTOM).  All values are
 \(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 @@ value is a list of the form (LEFT, TOP, RIGHT, BOTTOM).  All values are
 
   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 5da949e1fb..443a40ed6f 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
-- 

I think this should do the trick.

-- 
Alan Third



  reply	other threads:[~2017-05-22 19:21 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-20 14:58 [PATCH 01/13] Nextstep: Use instancetype explicit return type Philipp Stephani
2017-05-20 14:58 ` [PATCH 02/13] Declare Nextstep unexec functions in lisp.h Philipp Stephani
2017-05-20 14:58 ` [PATCH 03/13] Remove unused function print_regions Philipp Stephani
2017-05-20 14:58 ` [PATCH 04/13] Use NSCharacterCollection instead of CTCharacterCollection Philipp Stephani
2017-05-20 14:58 ` [PATCH 05/13] Make a function static that isn't used outside this file Philipp Stephani
2017-05-20 14:58 ` [PATCH 06/13] Remove calls to deprecated setUsesScreenFonts Philipp Stephani
2017-05-20 14:58 ` [PATCH 07/13] Remove trailing semicolons in method definitions Philipp Stephani
2017-05-20 14:58 ` [PATCH 08/13] Nextstep: remove some deprecated method calls Philipp Stephani
2017-05-20 14:58 ` [PATCH 09/13] Nextstep: Replace deprecated enumerators Philipp Stephani
2017-05-20 14:58 ` [PATCH 10/13] Remove unused automatic variables Philipp Stephani
2017-05-20 14:58 ` [PATCH 11/13] Clean up code around 'ns-list-services' Philipp Stephani
2017-05-20 14:58 ` [PATCH 12/13] Fix call of registerServicesMenuSendTypes Philipp Stephani
2017-05-20 14:58 ` [PATCH 13/13] Avoid uninitialized read Philipp Stephani
2017-05-21 15:30   ` John Wiegley
2017-05-20 20:23 ` [PATCH 01/13] Nextstep: Use instancetype explicit return type Paul Eggert
2017-05-20 22:45   ` mituharu
2017-05-21 20:00   ` Philipp Stephani
2017-05-22  2:36 ` Paul Eggert
2017-05-22 19:21   ` Alan Third [this message]
2017-05-23  9:46     ` [PATCH] Fix GNUstep build Paul Eggert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170522192103.GA50892@breton.holly.idiocy.org \
    --to=alan@idiocy.org \
    --cc=andlind@gmail.com \
    --cc=eggert@cs.ucla.edu \
    --cc=emacs-devel@gnu.org \
    --cc=p.stephani2@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).