On Mon, Oct 21, 2013 at 12:14 AM, Felix Buenemann wrote:
> Am 19.10.2013 um 18:54 schrieb björn:
>> On Sun, Oct 13, 2013 at 11:16 PM, Felix Bünemann wrote:
>>> Am Mittwoch, 9. Oktober 2013 20:25:49 UTC+2 schrieb björn:
>>>> On Wed, Oct 9, 2013 at 12:18 AM, Felix Bünemann wrote:
>>>>> I'm pretty sure that AvailabilityMacros.h is available on all versions of 
>>>>> OS
>>>>> X, because it's copyright header states 2001-20xx which matches the OS X
>>>>> 10.0 release timeline. Is the os_mac.h code also targeting OS 9? In that
>>>>> case we should add a configure check.
>>>>
>>>> Yes, pre-OS X should be supported.  If there is a suitable #ifdef
>>>> check for that, then it should be possible to submit as a patch to
>>>> mainline Vim.
>>>
>>> OK, I've updated the patch with a configure check:
>>> https://gist.github.com/felixbuenemann/6150257
>>
>> This looks good to me ... but should we perhaps be checking for
>> "Availability.h" instead as that is what is used on Mavericks (and
>> earlier OS X versions did not need explicit inclusion of
>> AvailabilityMacros.h)?
>
> The macros used in the vim codebase are defined in AvailabilityMacros.h not 
> Availability.h.
> Availability.h has similar but not the same macros, so using it would require 
> cluttering the code with even more ifdefs.

OK.  Well, then I think this solves the problem of compiling on OS X
10.9 neatly and that it could be included in mainline Vim.

Bram, can you please consider this patch for inclusion.  It should
apply cleanly (I just tried myself) and it automatically solves the
problem of us having to know exactly when this header was made
available.  I've pasted it below for your convenience.  Note that
Felix Bünemann wrote the patch, not me.

Thanks,
Björn


diff -r 92c9748e0ccb src/config.h.in
--- a/src/config.h.in Sun Oct 06 17:46:56 2013 +0200
+++ b/src/config.h.in Sun Oct 13 23:11:37 2013 +0200
@@ -442,3 +442,6 @@

 /* Define if you want Cygwin to use the WIN32 clipboard, not
compatible with X11*/
 #undef FEAT_CYGWIN_WIN32_CLIPBOARD
+
+/* Define if we have AvailabilityMacros.h on Mac OS X */
+#undef HAVE_AVAILABILITYMACROS_H
diff -r 92c9748e0ccb src/configure.in
--- a/src/configure.in Sun Oct 06 17:46:56 2013 +0200
+++ b/src/configure.in Sun Oct 13 23:11:37 2013 +0200
@@ -206,6 +206,10 @@
     dnl TODO: use -arch i386 on Intel machines
     CPPFLAGS="$CPPFLAGS -DMACOS_X_UNIX -no-cpp-precomp"

+    dnl Mac OS X 10.9+ no longer include AvailabilityMacros.h in Carbon
+    dnl so we need to include it to have access to version macros.
+    AC_CHECK_HEADER(AvailabilityMacros.h,[AC_DEFINE(HAVE_AVAILABILITYMACROS_H,
1, [ Define if we have AvailabilityMacros.h on Mac OS X ])])
+
     dnl If Carbon is found, assume we don't want X11
     dnl unless it was specifically asked for (--with-x)
     dnl or Motif, Athena or GTK GUI is used.
diff -r 92c9748e0ccb src/os_mac.h
--- a/src/os_mac.h Sun Oct 06 17:46:56 2013 +0200
+++ b/src/os_mac.h Sun Oct 13 23:11:37 2013 +0200
@@ -16,6 +16,11 @@
 # define OPAQUE_TOOLBOX_STRUCTS 0
 #endif

+/* Include MAC_OS_X_VERSION_* macros */
+#ifdef HAVE_AVAILABILITYMACROS_H
+# include <AvailabilityMacros.h>
+#endif
+
 /*
  * Macintosh machine-dependent things.
  *

-- 
-- 
You received this message from the "vim_mac" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_mac" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to