bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#27041: [PATCH] Check if instancetype supported in ObjC


From: npostavs
Subject: bug#27041: [PATCH] Check if instancetype supported in ObjC
Date: Thu, 25 May 2017 19:42:05 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2.50 (gnu/linux)

Alan Third <alan@idiocy.org> writes:

> --- a/configure.ac
> +++ b/configure.ac
> @@ -1980,6 +1980,23 @@ AC_DEFUN
>  AC_SUBST(NS_OBJ)
>  AC_SUBST(NS_OBJC_OBJ)
>  
> +AC_CACHE_CHECK(
> +  [if the Objective C compiler supports instancetype],
> +  [emacs_cv_objc_instancetype],
> +  [AC_LANG_PUSH([Objective C])
> +   AC_COMPILE_IFELSE(
> +     [AC_LANG_SOURCE([[@interface Test
> +                        + (instancetype)test;
> +                        @end]])],
> +     emacs_cv_objc_instancetype=yes,
> +     emacs_cv_objc_instancetype=no)
> +   AC_LANG_POP([Objective C])])
> +
> +if test x$emacs_cv_objc_instancetype = xyes ; then
> +  AC_DEFINE(NATIVE_OBJC_INSTANCETYPE, 1,
> +            [Define if ObjC compiler supports instancetype natively.])
> +fi
> +
>  HAVE_W32=no
>  W32_OBJ=
>  W32_LIBS=

I guess this should be inside 'if test "${HAVE_NS}" = yes; ...'
(although it seems harmless anyway).





reply via email to

[Prev in Thread] Current Thread [Next in Thread]