bug-gnulib
[Top][All Lists]
Advanced

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

[PATCH 02/16] extern-inline: avoid 'static inline'


From: Paul Eggert
Subject: [PATCH 02/16] extern-inline: avoid 'static inline'
Date: Sat, 18 Aug 2012 17:51:10 -0700
User-agent: Mozilla/5.0 (X11; Linux i686; rv:14.0) Gecko/20120714 Thunderbird/14.0

* m4/extern-inline.m4 (gl_EXTERN_INLINE):
Do not require AC_C_INLINE.
(_GL_INLINE, _GL_EXTERN_INLINE)
[! (__GNUC__ ? __GNUC_STDC_INLINE__ : 199901L <= __STDC_VERSION__)]:
Now 'static', not 'static inline'.  The 'inline' is just one more
portability hassle with pre-C99 compilers.  With GCC and Emacs and
the default optimization, 'static' generates significantly faster
code than 'static inline'.
---
 ChangeLog           |   10 ++++++++++
 m4/extern-inline.m4 |    5 ++---
 2 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index f1a7bc6..157df9d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
 2012-08-18  Paul Eggert  <address@hidden>
 
+       extern-inline: avoid 'static inline'
+       * m4/extern-inline.m4 (gl_EXTERN_INLINE):
+       Do not require AC_C_INLINE.
+       (_GL_INLINE, _GL_EXTERN_INLINE)
+       [! (__GNUC__ ? __GNUC_STDC_INLINE__ : 199901L <= __STDC_VERSION__)]:
+       Now 'static', not 'static inline'.  The 'inline' is just one more
+       portability hassle with pre-C99 compilers.  With GCC and Emacs and
+       the default optimization, 'static' generates significantly faster
+       code than 'static inline'.
+
        warn-on-use: do not depend on 'inline'
        * build-aux/snippet/warn-on-use.h: Remove unnecessary 'inline'
        from comment.
diff --git a/m4/extern-inline.m4 b/m4/extern-inline.m4
index 187a335..15349e4 100644
--- a/m4/extern-inline.m4
+++ b/m4/extern-inline.m4
@@ -7,7 +7,6 @@ dnl with or without modifications, as long as this notice is 
preserved.
 
 AC_DEFUN([gl_EXTERN_INLINE],
 [
-  AC_REQUIRE([AC_C_INLINE])
   AH_VERBATIM([extern_inline],
 [/* _GL_INLINE is a portable alternative to ISO C99 plain 'inline'.
    _GL_EXTERN_INLINE is a portable alternative to 'extern inline'.
@@ -30,8 +29,8 @@ AC_DEFUN([gl_EXTERN_INLINE],
      _Pragma ("GCC diagnostic pop")
 # endif
 #else
-# define _GL_INLINE static inline
-# define _GL_EXTERN_INLINE static inline
+# define _GL_INLINE static
+# define _GL_EXTERN_INLINE static
 #endif
 
 #ifndef _GL_INLINE_HEADER_BEGIN
-- 
1.7.6.5




reply via email to

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