]> code.delx.au - gnu-emacs/commitdiff
Port EXTERNALLY_VISIBLE to Clang 3.2.
authorPaul Eggert <eggert@cs.ucla.edu>
Fri, 28 Dec 2012 03:13:47 +0000 (19:13 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Fri, 28 Dec 2012 03:13:47 +0000 (19:13 -0800)
* conf_post.h (__has_attribute): New macro.
(EXTERNALLY_VISIBLE): Use it.  This ports to Clang 3.2.

src/ChangeLog
src/conf_post.h

index 3fabe7579a99a392efe604c083efc73dffbc6ec4..79d1982cc0e064b71b39c0126f43543b02646171 100644 (file)
@@ -1,3 +1,9 @@
+2012-12-28  Paul Eggert  <eggert@cs.ucla.edu>
+
+       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  <rgm@gnu.org>
 
        * cygw32.c (Fcygwin_convert_file_name_to_windows)
index b1997e79081d5267afc04ebc279cc067c5d1af6c..37a426fc451d91e390cfed67537ee65b25397fc9 100644 (file)
@@ -40,6 +40,10 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 #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