From: Paul Eggert Date: Fri, 28 Dec 2012 03:13:47 +0000 (-0800) Subject: Port EXTERNALLY_VISIBLE to Clang 3.2. X-Git-Tag: emacs-24.3.90~173^2~7^2~466 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=7456e13fa946233d1b4f0beb8371962de5012265;p=emacs.git Port EXTERNALLY_VISIBLE to Clang 3.2. * conf_post.h (__has_attribute): New macro. (EXTERNALLY_VISIBLE): Use it. This ports to Clang 3.2. --- 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