]> Savannah Git Hosting - gnulib.git/commitdiff
Use expression statements also on clang.
authorBruno Haible <bruno@clisp.org>
Tue, 11 Aug 2020 16:36:25 +0000 (18:36 +0200)
committerBruno Haible <bruno@clisp.org>
Tue, 11 Aug 2020 16:36:25 +0000 (18:36 +0200)
* lib/cdefs.h (__extension__): Don't define to empty on clang.
* lib/obstack.h (__extension__): Likewise.
(obstack_object_size, obstack_room, obstack_make_room, obstack_empty_p,
obstack_grow, obstack_grow0, obstack_1grow, obstack_ptr_grow,
obstack_int_grow, obstack_ptr_grow_fast, obstack_int_grow_fast,
obstack_blank, obstack_alloc, obstack_copy, obstack_copy0,
obstack_finish, obstack_free): Enable as optimized macros also on clang.
* lib/fpucw.h (fpucw_t etc.): Enable the definitions also on clang.

ChangeLog
lib/cdefs.h
lib/fpucw.h
lib/obstack.h

index 3465570c19bc199b7efd044877f0471814b18b0a..460e6f166336e687732f6316b07e86e3a54ce1de 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2020-08-11  Bruno Haible  <bruno@clisp.org>
+
+       Use expression statements also on clang.
+       * lib/cdefs.h (__extension__): Don't define to empty on clang.
+       * lib/obstack.h (__extension__): Likewise.
+       (obstack_object_size, obstack_room, obstack_make_room, obstack_empty_p,
+       obstack_grow, obstack_grow0, obstack_1grow, obstack_ptr_grow,
+       obstack_int_grow, obstack_ptr_grow_fast, obstack_int_grow_fast,
+       obstack_blank, obstack_alloc, obstack_copy, obstack_copy0,
+       obstack_finish, obstack_free): Enable as optimized macros also on clang.
+       * lib/fpucw.h (fpucw_t etc.): Enable the definitions also on clang.
+
 2020-08-10  Bruno Haible  <bruno@clisp.org>
 
        Use many __attribute__s with clang.
index 170d9e63404c4faef979738094b15ca88028a6b0..00652549d78d97cd3dedd8959dd9cbb527a1dd20 100644 (file)
    run in pedantic mode if the uses are carefully marked using the
    `__extension__' keyword.  But this is not generally available before
    version 2.8.  */
-#if !__GNUC_PREREQ (2,8)
+#if !(__GNUC_PREREQ (2,8) || defined __clang__)
 # define __extension__         /* Ignore */
 #endif
 
index 1c6edf6b76416a3135e1cebcdc6d73d7deee5656..8ef542022383dd354d323c2ae512b9eae069599d 100644 (file)
@@ -61,8 +61,8 @@
                                     'long double' safe operation precision
  */
 
-/* Inline assembler like this works only with GNU C.  */
-#if (defined __i386__ || defined __x86_64__) && defined __GNUC__
+/* Inline assembler like this works only with GNU C and clang.  */
+#if (defined __i386__ || defined __x86_64__) && (defined __GNUC__ || defined __clang__)
 
 typedef unsigned short fpucw_t; /* glibc calls this fpu_control_t */
 
index 987bd3b12ce2837625579e1da624417570f7172e..94524086507d7983406603ff4744a7b2f53e930b 100644 (file)
@@ -283,8 +283,9 @@ extern int obstack_exit_failure;
 
 #define obstack_memory_used(h) _obstack_memory_used (h)
 
-#if defined __GNUC__
-# if !defined __GNUC_MINOR__ || __GNUC__ * 1000 + __GNUC_MINOR__ < 2008
+#if defined __GNUC__ || defined __clang__
+# if !(defined __GNUC_MINOR__ && __GNUC__ * 1000 + __GNUC_MINOR__ >= 2008 \
+       || defined __clang__)
 #  define __extension__
 # endif