summaryrefslogtreecommitdiff
path: root/src/nsterm.h
diff options
context:
space:
mode:
authorAlan Third <alan@idiocy.org>2017-05-25 19:23:39 +0100
committerAlan Third <alan@idiocy.org>2017-05-27 00:46:23 +0100
commit0d676deba49ccab9a6a07bc1deeacff51dd44cbf (patch)
treefb8cd2f9f9f239d09e4ea9cb260e63c9b8b6035f /src/nsterm.h
parentdc79aa10f117dea1204634626a5f96a21722807f (diff)
downloademacs-0d676deba49ccab9a6a07bc1deeacff51dd44cbf.tar.gz
Check if instancetype supported in ObjC
* configure.ac: Add check for instancetype. * src/nsterm.h [!NATIVE_OBJC_INSTANCETYPE]: Define instancetype.
Diffstat (limited to 'src/nsterm.h')
-rw-r--r--src/nsterm.h20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/nsterm.h b/src/nsterm.h
index 8f3d92b3537..f75e3759e4f 100644
--- a/src/nsterm.h
+++ b/src/nsterm.h
@@ -62,15 +62,6 @@ typedef CGFloat EmacsCGFloat;
typedef float EmacsCGFloat;
#endif
-/* FIXME: instancetype is a language built-in, but older versions of
- Clang don't support it, and I don't know if GCC supports it at all.
- Should this be tested for in ./configure? */
-#if defined (NS_IMPL_GNUSTEP)
- || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_10
-typedef id instancetype;
-typedef NSUInteger NSWindowStyleMask;
-#endif
-
/* ==========================================================================
Trace support
@@ -365,6 +356,12 @@ char const * nstrace_fullscreen_type_name (int);
#endif
+/* If the compiler doesn't support instancetype, map it to id. */
+#ifndef NATIVE_OBJC_INSTANCETYPE
+typedef id instancetype;
+#endif
+
+
/* ==========================================================================
NSColor, EmacsColor category.
@@ -1302,6 +1299,11 @@ extern char gnustep_base_version[]; /* version tracking */
#define NSWindowStyleMaskUtilityWindow NSUtilityWindowMask
#define NSAlertStyleCritical NSCriticalAlertStyle
#define NSControlSizeRegular NSRegularControlSize
+
+/* And adds NSWindowStyleMask. */
+#ifdef __OBJC__
+typedef NSUInteger NSWindowStyleMask;
+#endif
#endif
#endif /* HAVE_NS */