From 7456e13fa946233d1b4f0beb8371962de5012265 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Thu, 27 Dec 2012 19:13:47 -0800 Subject: [PATCH] Port EXTERNALLY_VISIBLE to Clang 3.2. * conf_post.h (__has_attribute): New macro. (EXTERNALLY_VISIBLE): Use it. This ports to Clang 3.2. --- src/ChangeLog | 6 ++++++ src/conf_post.h | 8 +++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index 3fabe7579a9..79d1982cc0e 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2012-12-28 Paul Eggert + + Port EXTERNALLY_VISIBLE to Clang 3.2. + * conf_post.h (__has_attribute): New macro. + (EXTERNALLY_VISIBLE): Use it. This ports to Clang 3.2. + 2012-12-27 Glenn Morris * cygw32.c (Fcygwin_convert_file_name_to_windows) diff --git a/src/conf_post.h b/src/conf_post.h index b1997e79081..37a426fc451 100644 --- a/src/conf_post.h +++ b/src/conf_post.h @@ -40,6 +40,10 @@ along with GNU Emacs. If not, see . */ #endif #endif +#ifndef __has_attribute +# define __has_attribute(a) 0 /* non-clang */ +#endif + /* This silences a few compilation warnings on FreeBSD. */ #ifdef BSD_SYSTEM_AHB #undef BSD_SYSTEM_AHB @@ -191,7 +195,9 @@ extern void _DebPrint (const char *fmt, ...); #define NO_INLINE #endif -#if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1)) +#if (__clang__ \ + ? __has_attribute (externally_visible) \ + : (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1))) #define EXTERNALLY_VISIBLE __attribute__((externally_visible)) #else #define EXTERNALLY_VISIBLE -- 2.39.5