emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r109393: Use C99-style 'extern inline


From: Paul Eggert
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r109393: Use C99-style 'extern inline' if available.
Date: Thu, 02 Aug 2012 00:31:34 -0700
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 109393
committer: Paul Eggert <address@hidden>
branch nick: trunk
timestamp: Thu 2012-08-02 00:31:34 -0700
message:
  Use C99-style 'extern inline' if available.
  
  * lib-src/profile.c (SYSTIME_INLINE): Define.
  * nt/config.nt: Sync with autogen/config.in.
  (_GL_INLINE, _GL_EXTERN_INLINE, _GL_INLINE_HEADER_BEGIN)
  (_GL_INLINE_HEADER_END): New macros.
  * src/buffer.h (BUFFER_INLINE):
  * src/category.h (CATEGORY_INLINE):
  * src/character.h (CHARACTER_INLINE):
  * src/charset.h (CHARSET_INLINE):
  * src/composite.h (COMPOSITE_INLINE):
  * src/dispextern.h (DISPEXTERN_INLINE):
  * src/lisp.h (LISP_INLINE):
  * src/systime.h (SYSTIME_INLINE):
  New macro, replacing 'static inline' in this header.
  * src/buffer.h, src/category.h, src/character.h, src/charset.h:
  * src/composite.h, src/dispextern.h, lisp.h, systime.h:
  Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
  * src/alloc.c (LISP_INLINE):
  * src/buffer.c (BUFFER_INLINE):
  * src/category.c (CATEGORY_INLINE):
  * src/character.c (CHARACTER_INLINE):
  * src/charset.c (CHARSET_INLINE):
  * src/composite.c (COMPOSITE_INLINE):
  * src/dispnew.c (DISPEXTERN_INLINE):
  * src/sysdep.c (SYSTIME_INLINE):
  Define to EXTERN_INLINE, so that the corresponding functions
  are compiled into code.
  * src/conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
  (INLINE_HEADER_END): New macros.
  * src/lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
  since it's used in non-static inline functions now.
modified:
  lib-src/ChangeLog
  lib-src/profile.c
  nt/ChangeLog
  nt/config.nt
  src/ChangeLog
  src/alloc.c
  src/buffer.c
  src/buffer.h
  src/category.c
  src/category.h
  src/character.c
  src/character.h
  src/charset.c
  src/charset.h
  src/composite.c
  src/composite.h
  src/conf_post.h
  src/dispextern.h
  src/dispnew.c
  src/lisp.h
  src/sysdep.c
  src/systime.h
=== modified file 'lib-src/ChangeLog'
--- a/lib-src/ChangeLog 2012-08-02 06:19:48 +0000
+++ b/lib-src/ChangeLog 2012-08-02 07:31:34 +0000
@@ -1,3 +1,8 @@
+2012-08-02  Paul Eggert  <address@hidden>
+
+       Use C99-style 'extern inline' if available.
+       * profile.c (SYSTIME_INLINE): Define.
+
 2012-08-02  Glenn Morris  <address@hidden>
 
        * makefile.w32-in (MS_W32_H): Update for new ms-w32.h location.

=== modified file 'lib-src/profile.c'
--- a/lib-src/profile.c 2012-07-10 23:24:36 +0000
+++ b/lib-src/profile.c 2012-08-02 07:31:34 +0000
@@ -30,6 +30,8 @@
  */
 #include <config.h>
 
+#define SYSTIME_INLINE EXTERN_INLINE
+
 #include <inttypes.h>
 #include <stdio.h>
 

=== modified file 'nt/ChangeLog'
--- a/nt/ChangeLog      2012-08-02 06:19:48 +0000
+++ b/nt/ChangeLog      2012-08-02 07:31:34 +0000
@@ -1,3 +1,10 @@
+2012-08-02  Paul Eggert  <address@hidden>
+
+       Use C99-style 'extern inline' if available.
+       * config.nt: Sync with autogen/config.in.
+       (_GL_INLINE, _GL_EXTERN_INLINE, _GL_INLINE_HEADER_BEGIN)
+       (_GL_INLINE_HEADER_END): New macros.
+
 2012-08-02  Glenn Morris  <address@hidden>
 
        * inc/ms-w32.h: Move here from ../src/s.

=== modified file 'nt/config.nt'
--- a/nt/config.nt      2012-08-02 06:19:48 +0000
+++ b/nt/config.nt      2012-08-02 07:31:34 +0000
@@ -1540,6 +1540,35 @@
    configuration information. */
 #define config_opsysfile <ms-w32.h>
 
+/* _GL_INLINE is a portable alternative to ISO C99 plain 'inline'.
+   _GL_EXTERN_INLINE is a portable alternative to 'extern inline'.
+   _GL_INLINE_HEADER_BEGIN contains useful stuff to put
+     in an include file, before uses of _GL_INLINE.
+     It suppresses GCC's bogus "no previous prototype for 'FOO'" diagnostic,
+     when FOO is an inline function in the header; see
+     <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54113>.
+   _GL_INLINE_HEADER_END contains useful stuff to put
+     in the same include file, after uses of _GL_INLINE.  */
+#if __GNUC__ ? __GNUC_STDC_INLINE__ : 199901L <= __STDC_VERSION__
+# define _GL_INLINE inline
+# define _GL_EXTERN_INLINE extern inline
+# if (__GNUC__ == 4 && 6 <= __GNUC_MINOR__) || 4 < __GNUC__
+#  define _GL_INLINE_HEADER_BEGIN \
+     _Pragma ("GCC diagnostic push") \
+     _Pragma ("GCC diagnostic ignored \"-Wmissing-prototypes\"")
+#  define _GL_INLINE_HEADER_END \
+     _Pragma ("GCC diagnostic pop")
+# endif
+#else
+# define _GL_INLINE static inline
+# define _GL_EXTERN_INLINE static inline
+#endif
+
+#ifndef _GL_INLINE_HEADER_BEGIN
+# define _GL_INLINE_HEADER_BEGIN
+# define _GL_INLINE_HEADER_END
+#endif
+
 /* A replacement for va_copy, if needed.  */
 #define gl_va_copy(a,b) ((a) = (b))
 

=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2012-08-02 06:21:48 +0000
+++ b/src/ChangeLog     2012-08-02 07:31:34 +0000
@@ -1,3 +1,33 @@
+2012-08-02  Paul Eggert  <address@hidden>
+
+       Use C99-style 'extern inline' if available.
+       * buffer.h (BUFFER_INLINE):
+       * category.h (CATEGORY_INLINE):
+       * character.h (CHARACTER_INLINE):
+       * charset.h (CHARSET_INLINE):
+       * composite.h (COMPOSITE_INLINE):
+       * dispextern.h (DISPEXTERN_INLINE):
+       * lisp.h (LISP_INLINE):
+       * systime.h (SYSTIME_INLINE):
+       New macro, replacing 'static inline' in this header.
+       * buffer.h, category.h, character.h, charset.h, composite.h:
+       * dispextern.h, lisp.h, systime.h:
+       Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
+       * alloc.c (LISP_INLINE):
+       * buffer.c (BUFFER_INLINE):
+       * category.c (CATEGORY_INLINE):
+       * character.c (CHARACTER_INLINE):
+       * charset.c (CHARSET_INLINE):
+       * composite.c (COMPOSITE_INLINE):
+       * dispnew.c (DISPEXTERN_INLINE):
+       * sysdep.c (SYSTIME_INLINE):
+       Define to EXTERN_INLINE, so that the corresponding functions
+       are compiled into code.
+       * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
+       (INLINE_HEADER_END): New macros.
+       * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
+       since it's used in non-static inline functions now.
+
 2012-08-02  Glenn Morris  <address@hidden>
 
        * s/: Remove empty directory.

=== modified file 'src/alloc.c'
--- a/src/alloc.c       2012-08-01 08:49:28 +0000
+++ b/src/alloc.c       2012-08-02 07:31:34 +0000
@@ -19,6 +19,9 @@
 along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include <config.h>
+
+#define LISP_INLINE EXTERN_INLINE
+
 #include <stdio.h>
 #include <limits.h>            /* For CHAR_BIT.  */
 #include <setjmp.h>

=== modified file 'src/buffer.c'
--- a/src/buffer.c      2012-08-01 08:49:28 +0000
+++ b/src/buffer.c      2012-08-02 07:31:34 +0000
@@ -19,6 +19,8 @@
 
 #include <config.h>
 
+#define BUFFER_INLINE EXTERN_INLINE
+
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <sys/param.h>

=== modified file 'src/buffer.h'
--- a/src/buffer.h      2012-08-01 08:49:28 +0000
+++ b/src/buffer.h      2012-08-02 07:31:34 +0000
@@ -21,6 +21,11 @@
 #include <sys/types.h> /* for off_t, time_t */
 #include "systime.h" /* for EMACS_TIME */
 
+INLINE_HEADER_BEGIN
+#ifndef BUFFER_INLINE
+# define BUFFER_INLINE INLINE
+#endif
+
 /* Accessing the parameters of the current buffer.  */
 
 /* These macros come in pairs, one for the char position
@@ -961,7 +966,7 @@
    the buffer to the next character after fetching this one.  Instead,
    use either FETCH_CHAR_ADVANCE or STRING_CHAR_AND_LENGTH.  */
 
-static inline int
+BUFFER_INLINE int
 FETCH_MULTIBYTE_CHAR (ptrdiff_t pos)
 {
   unsigned char *p = ((pos >= GPT_BYTE ? GAP_SIZE : 0)
@@ -973,7 +978,7 @@
    If POS doesn't point the head of valid multi-byte form, only the byte at
    POS is returned.  No range checking.  */
 
-static inline int
+BUFFER_INLINE int
 BUF_FETCH_MULTIBYTE_CHAR (struct buffer *buf, ptrdiff_t pos)
 {
   unsigned char *p
@@ -1090,7 +1095,7 @@
       (*(Lisp_Object *)((OFFSET) + (char *) (BUFFER)))
 
 /* Downcase a character C, or make no change if that cannot be done.  */
-static inline int
+BUFFER_INLINE int
 downcase (int c)
 {
   Lisp_Object downcase_table = BVAR (current_buffer, downcase_table);
@@ -1099,10 +1104,10 @@
 }
 
 /* 1 if C is upper case.  */
-static inline int uppercasep (int c) { return downcase (c) != c; }
+BUFFER_INLINE int uppercasep (int c) { return downcase (c) != c; }
 
 /* Upcase a character C known to be not upper case.  */
-static inline int
+BUFFER_INLINE int
 upcase1 (int c)
 {
   Lisp_Object upcase_table = BVAR (current_buffer, upcase_table);
@@ -1111,8 +1116,10 @@
 }
 
 /* 1 if C is lower case.  */
-static inline int lowercasep (int c)
+BUFFER_INLINE int lowercasep (int c)
 { return !uppercasep (c) && upcase1 (c) != c; }
 
 /* Upcase a character C, or make no change if that cannot be done.  */
-static inline int upcase (int c) { return uppercasep (c) ? c : upcase1 (c); }
+BUFFER_INLINE int upcase (int c) { return uppercasep (c) ? c : upcase1 (c); }
+
+INLINE_HEADER_END

=== modified file 'src/category.c'
--- a/src/category.c    2012-06-16 12:24:15 +0000
+++ b/src/category.c    2012-08-02 07:31:34 +0000
@@ -29,6 +29,9 @@
    table.  Read comments in the file category.h to understand them.  */
 
 #include <config.h>
+
+#define CATEGORY_INLINE EXTERN_INLINE
+
 #include <ctype.h>
 #include <setjmp.h>
 #include "lisp.h"

=== modified file 'src/category.h'
--- a/src/category.h    2012-06-16 08:20:19 +0000
+++ b/src/category.h    2012-08-02 07:31:34 +0000
@@ -53,6 +53,11 @@
    The second extra slot is a version number of the category table.
    But, for the moment, we are not using this slot.  */
 
+INLINE_HEADER_BEGIN
+#ifndef CATEGORY_INLINE
+# define CATEGORY_INLINE INLINE
+#endif
+
 #define CATEGORYP(x) RANGED_INTEGERP (0x20, x, 0x7E)
 
 #define CHECK_CATEGORY(x) \
@@ -79,7 +84,7 @@
     >> ((category) % 8)) & 1)
 
 /* Return 1 if category set of CH contains CATEGORY, else return 0.  */
-static inline int
+CATEGORY_INLINE int
 CHAR_HAS_CATEGORY (int ch, int category)
 {
   Lisp_Object category_set = CATEGORY_SET (ch);
@@ -108,3 +113,5 @@
    && word_boundary_p (c1, c2))
 
 extern int word_boundary_p (int, int);
+
+INLINE_HEADER_END

=== modified file 'src/character.c'
--- a/src/character.c   2012-07-16 04:47:31 +0000
+++ b/src/character.c   2012-08-02 07:31:34 +0000
@@ -29,6 +29,8 @@
 #include <config.h>
 #endif
 
+#define CHARACTER_INLINE EXTERN_INLINE
+
 #include <stdio.h>
 
 #ifdef emacs

=== modified file 'src/character.h'
--- a/src/character.h   2012-07-09 16:38:45 +0000
+++ b/src/character.h   2012-08-02 07:31:34 +0000
@@ -25,6 +25,11 @@
 
 #include <verify.h>
 
+INLINE_HEADER_BEGIN
+#ifndef CHARACTER_INLINE
+# define CHARACTER_INLINE INLINE
+#endif
+
 /* character code      1st byte   byte sequence
    --------------      --------   -------------
         0-7F           00..7F     0xxxxxxx
@@ -570,7 +575,7 @@
 
 #define SANE_TAB_WIDTH(buf) \
   sanitize_tab_width (XFASTINT (BVAR (buf, tab_width)))
-static inline int
+CHARACTER_INLINE int
 sanitize_tab_width (EMACS_INT width)
 {
   return 0 < width && width <= 1000 ? width : 8;
@@ -591,7 +596,7 @@
 
 /* Return a non-outlandish value for a character width.  */
 
-static inline int
+CHARACTER_INLINE int
 sanitize_char_width (EMACS_INT width)
 {
   return 0 <= width && width <= 1000 ? width : 1000;
@@ -695,4 +700,6 @@
 #define GET_TRANSLATION_TABLE(id) \
   (XCDR(XVECTOR(Vtranslation_table_vector)->contents[(id)]))
 
+INLINE_HEADER_END
+
 #endif /* EMACS_CHARACTER_H */

=== modified file 'src/charset.c'
--- a/src/charset.c     2012-08-01 20:51:44 +0000
+++ b/src/charset.c     2012-08-02 07:31:34 +0000
@@ -26,6 +26,8 @@
 
 #include <config.h>
 
+#define CHARSET_INLINE EXTERN_INLINE
+
 #include <stdio.h>
 #include <unistd.h>
 #include <ctype.h>

=== modified file 'src/charset.h'
--- a/src/charset.h     2012-08-01 20:51:44 +0000
+++ b/src/charset.h     2012-08-02 07:31:34 +0000
@@ -29,6 +29,11 @@
 
 #include <verify.h>
 
+INLINE_HEADER_BEGIN
+#ifndef CHARSET_INLINE
+# define CHARSET_INLINE INLINE
+#endif
+
 /* Index to arguments of Fdefine_charset_internal.  */
 
 enum define_charset_arg_index
@@ -325,7 +330,7 @@
 #define CHARSET_DEUNIFIER(charset)     \
   (CHARSET_ATTR_DEUNIFIER (CHARSET_ATTRIBUTES (charset)))
 
-static inline void
+CHARSET_INLINE void
 set_charset_attr (struct charset *charset, enum charset_attr_index idx,
                  Lisp_Object val)
 {
@@ -541,4 +546,6 @@
                                Lisp_Object, Lisp_Object,
                                struct charset *, unsigned, unsigned);
 
+INLINE_HEADER_END
+
 #endif /* EMACS_CHARSET_H */

=== modified file 'src/composite.c'
--- a/src/composite.c   2012-08-01 20:51:44 +0000
+++ b/src/composite.c   2012-08-02 07:31:34 +0000
@@ -23,6 +23,9 @@
 along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include <config.h>
+
+#define COMPOSITE_INLINE EXTERN_INLINE
+
 #include <setjmp.h>
 #include "lisp.h"
 #include "character.h"

=== modified file 'src/composite.h'
--- a/src/composite.h   2012-08-01 20:51:44 +0000
+++ b/src/composite.h   2012-08-02 07:31:34 +0000
@@ -25,6 +25,11 @@
 #ifndef EMACS_COMPOSITE_H
 #define EMACS_COMPOSITE_H
 
+INLINE_HEADER_BEGIN
+#ifndef COMPOSITE_INLINE
+# define COMPOSITE_INLINE INLINE
+#endif
+
 /* Methods to display a sequence of components of a composition.  */
 enum composition_method {
   /* Compose relatively without alternate characters.  */
@@ -247,7 +252,7 @@
 #define LGSTRING_GLYPH_LEN(lgs) (ASIZE ((lgs)) - 2)
 #define LGSTRING_GLYPH(lgs, idx) AREF ((lgs), (idx) + 2)
 #define LGSTRING_SET_GLYPH(lgs, idx, val) ASET ((lgs), (idx) + 2, (val))
-static inline Lisp_Object *
+COMPOSITE_INLINE Lisp_Object *
 lgstring_glyph_addr (Lisp_Object lgs, ptrdiff_t idx)
 {
   return aref_addr (lgs, idx + 2);
@@ -321,4 +326,6 @@
 
 extern ptrdiff_t composition_adjust_point (ptrdiff_t, ptrdiff_t);
 
+INLINE_HEADER_END
+
 #endif /* not EMACS_COMPOSITE_H */

=== modified file 'src/conf_post.h'
--- a/src/conf_post.h   2012-08-01 15:33:09 +0000
+++ b/src/conf_post.h   2012-08-02 07:31:34 +0000
@@ -213,4 +213,9 @@
 #undef noinline
 #endif
 
+#define INLINE _GL_INLINE
+#define EXTERN_INLINE _GL_EXTERN_INLINE
+#define INLINE_HEADER_BEGIN _GL_INLINE_HEADER_BEGIN
+#define INLINE_HEADER_END _GL_INLINE_HEADER_END
+
 /* conf_post.h ends here */

=== modified file 'src/dispextern.h'
--- a/src/dispextern.h  2012-08-01 05:11:36 +0000
+++ b/src/dispextern.h  2012-08-02 07:31:34 +0000
@@ -46,8 +46,13 @@
 #include "msdos.h"
 #endif
 
+INLINE_HEADER_BEGIN
+#ifndef DISPEXTERN_INLINE
+# define DISPEXTERN_INLINE INLINE
+#endif
+
 #include <c-strcase.h>
-static inline int
+DISPEXTERN_INLINE int
 xstrcasecmp (char const *a, char const *b)
 {
   return c_strcasecmp (a, b);
@@ -3400,4 +3405,6 @@
 
 #endif /* HAVE_WINDOW_SYSTEM */
 
+INLINE_HEADER_END
+
 #endif /* not DISPEXTERN_H_INCLUDED */

=== modified file 'src/dispnew.c'
--- a/src/dispnew.c     2012-08-01 05:11:36 +0000
+++ b/src/dispnew.c     2012-08-02 07:31:34 +0000
@@ -18,6 +18,9 @@
 along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include <config.h>
+
+#define DISPEXTERN_INLINE EXTERN_INLINE
+
 #include <signal.h>
 #include <stdio.h>
 #include <ctype.h>

=== modified file 'src/lisp.h'
--- a/src/lisp.h        2012-08-01 20:51:44 +0000
+++ b/src/lisp.h        2012-08-02 07:31:34 +0000
@@ -28,6 +28,11 @@
 
 #include <intprops.h>
 
+INLINE_HEADER_BEGIN
+#ifndef LISP_INLINE
+# define LISP_INLINE INLINE
+#endif
+
 /* The ubiquitous max and min macros.  */
 #undef min
 #undef max
@@ -295,14 +300,14 @@
 typedef struct { EMACS_INT i; } Lisp_Object;
 
 #define XLI(o) (o).i
-static inline Lisp_Object
+LISP_INLINE Lisp_Object
 XIL (EMACS_INT i)
 {
   Lisp_Object o = { i };
   return o;
 }
 
-static inline Lisp_Object
+LISP_INLINE Lisp_Object
 LISP_MAKE_RVALUE (Lisp_Object o)
 {
     return o;
@@ -330,7 +335,9 @@
 
 /* In the size word of a struct Lisp_Vector, this bit means it's really
    some other vector-like object.  */
-static ptrdiff_t const PSEUDOVECTOR_FLAG = PTRDIFF_MAX - PTRDIFF_MAX / 2;
+static ptrdiff_t const PSEUDOVECTOR_FLAG
+#define PSEUDOVECTOR_FLAG (PTRDIFF_MAX - PTRDIFF_MAX / 2)
+      = PSEUDOVECTOR_FLAG;
 
 /* In a pseudovector, the size field actually contains a word with one
    PSEUDOVECTOR_FLAG bit set, and exactly one of the following bits to
@@ -480,7 +487,7 @@
 #define FIXNUM_OVERFLOW_P(i) \
   (! ((0 <= (i) || MOST_NEGATIVE_FIXNUM <= (i)) && (i) <= 
MOST_POSITIVE_FIXNUM))
 
-static inline ptrdiff_t
+LISP_INLINE ptrdiff_t
 clip_to_bounds (ptrdiff_t lower, EMACS_INT num, ptrdiff_t upper)
 {
   return num < lower ? lower : num <= upper ? num : upper;
@@ -2338,37 +2345,37 @@
 
 /* Simple access functions.  */
 
-static inline Lisp_Object *
+LISP_INLINE Lisp_Object *
 aref_addr (Lisp_Object array, ptrdiff_t idx)
 {
   return & XVECTOR (array)->contents[idx];
 }
 
-static inline void
+LISP_INLINE void
 set_hash_key (struct Lisp_Hash_Table *h, ptrdiff_t idx, Lisp_Object val)
 {
   ASET (h->key_and_value, 2 * idx, val);
 }
 
-static inline void
+LISP_INLINE void
 set_hash_value (struct Lisp_Hash_Table *h, ptrdiff_t idx, Lisp_Object val)
 {
   ASET (h->key_and_value, 2 * idx + 1, val);
 }
 
-static inline void
+LISP_INLINE void
 set_hash_next (struct Lisp_Hash_Table *h, ptrdiff_t idx, Lisp_Object val)
 {
   ASET (h->next, idx, val);
 }
 
-static inline void
+LISP_INLINE void
 set_hash_hash (struct Lisp_Hash_Table *h, ptrdiff_t idx, Lisp_Object val)
 {
   ASET (h->hash, idx, val);
 }
 
-static inline void
+LISP_INLINE void
 set_hash_index (struct Lisp_Hash_Table *h, ptrdiff_t idx, Lisp_Object val)
 {
   ASET (h->index, idx, val);
@@ -2692,7 +2699,7 @@
 
 /* Make unibyte string from C string when the length isn't known.  */
 
-static inline Lisp_Object
+LISP_INLINE Lisp_Object
 build_unibyte_string (const char *str)
 {
   return make_unibyte_string (str, strlen (str));
@@ -2710,7 +2717,7 @@
 
 /* Make a string allocated in pure space, use STR as string data.  */
 
-static inline Lisp_Object
+LISP_INLINE Lisp_Object
 build_pure_c_string (const char *str)
 {
   return make_pure_c_string (str, strlen (str));
@@ -2719,7 +2726,7 @@
 /* Make a string from the data at STR, treating it as multibyte if the
    data warrants.  */
 
-static inline Lisp_Object
+LISP_INLINE Lisp_Object
 build_string (const char *str)
 {
   return make_string (str, strlen (str));
@@ -2838,13 +2845,13 @@
 extern void init_lread (void);
 extern void syms_of_lread (void);
 
-static inline Lisp_Object
+LISP_INLINE Lisp_Object
 intern (const char *str)
 {
   return intern_1 (str, strlen (str));
 }
 
-static inline Lisp_Object
+LISP_INLINE Lisp_Object
 intern_c_string (const char *str)
 {
   return intern_c_string_1 (str, strlen (str));
@@ -3493,7 +3500,7 @@
 
 /* Check whether it's time for GC, and run it if so.  */
 
-static inline void
+LISP_INLINE void
 maybe_gc (void)
 {
   if ((consing_since_gc > gc_cons_threshold
@@ -3503,4 +3510,6 @@
     Fgarbage_collect ();
 }
 
+INLINE_HEADER_END
+
 #endif /* EMACS_LISP_H */

=== modified file 'src/sysdep.c'
--- a/src/sysdep.c      2012-08-02 04:14:48 +0000
+++ b/src/sysdep.c      2012-08-02 07:31:34 +0000
@@ -18,6 +18,9 @@
 along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include <config.h>
+
+#define SYSTIME_INLINE EXTERN_INLINE
+
 #include <ctype.h>
 #include <signal.h>
 #include <stdio.h>

=== modified file 'src/systime.h'
--- a/src/systime.h     2012-07-14 11:32:01 +0000
+++ b/src/systime.h     2012-08-02 07:31:34 +0000
@@ -21,6 +21,11 @@
 
 #include <timespec.h>
 
+INLINE_HEADER_BEGIN
+#ifndef SYSTIME_INLINE
+# define SYSTIME_INLINE INLINE
+#endif
+
 #ifdef emacs
 # ifdef HAVE_X_WINDOWS
 #  include <X11/X.h>
@@ -54,12 +59,12 @@
 /* EMACS_SECS (TIME) is the seconds component of TIME.
    EMACS_NSECS (TIME) is the nanoseconds component of TIME.
    emacs_secs_addr (PTIME) is the address of *PTIME's seconds component.  */
-static inline time_t EMACS_SECS (EMACS_TIME t) { return t.tv_sec; }
-static inline int EMACS_NSECS (EMACS_TIME t) { return t.tv_nsec; }
-static inline time_t *emacs_secs_addr (EMACS_TIME *t) { return &t->tv_sec; }
+SYSTIME_INLINE time_t EMACS_SECS (EMACS_TIME t) { return t.tv_sec; }
+SYSTIME_INLINE int EMACS_NSECS (EMACS_TIME t) { return t.tv_nsec; }
+SYSTIME_INLINE time_t *emacs_secs_addr (EMACS_TIME *t) { return &t->tv_sec; }
 
 /* Return an Emacs time with seconds S and nanoseconds NS.  */
-static inline EMACS_TIME
+SYSTIME_INLINE EMACS_TIME
 make_emacs_time (time_t s, int ns)
 {
   EMACS_TIME r = { s, ns };
@@ -67,7 +72,7 @@
 }
 
 /* Return an invalid Emacs time.  */
-static inline EMACS_TIME
+SYSTIME_INLINE EMACS_TIME
 invalid_emacs_time (void)
 {
   EMACS_TIME r = { 0, -1 };
@@ -75,7 +80,7 @@
 }
 
 /* Return current system time.  */
-static inline EMACS_TIME
+SYSTIME_INLINE EMACS_TIME
 current_emacs_time (void)
 {
   EMACS_TIME r;
@@ -92,12 +97,12 @@
    be used with their first argument an absolute time since the epoch
    and the second argument a non-negative offset.  Do NOT use them for
    anything else.  */
-static inline EMACS_TIME
+SYSTIME_INLINE EMACS_TIME
 add_emacs_time (EMACS_TIME a, EMACS_TIME b)
 {
   return timespec_add (a, b);
 }
-static inline EMACS_TIME
+SYSTIME_INLINE EMACS_TIME
 sub_emacs_time (EMACS_TIME a, EMACS_TIME b)
 {
   return timespec_sub (a, b);
@@ -106,14 +111,14 @@
 /* Return the sign of the valid time stamp TIME, either -1, 0, or 1.
    Note: this can only return a negative value if time_t is a signed
    data type.  */
-static inline int
+SYSTIME_INLINE int
 EMACS_TIME_SIGN (EMACS_TIME t)
 {
   return timespec_sign (t);
 }
 
 /* Return 1 if TIME is a valid time stamp.  */
-static inline int
+SYSTIME_INLINE int
 EMACS_TIME_VALID_P (EMACS_TIME t)
 {
   return 0 <= t.tv_nsec;
@@ -123,14 +128,14 @@
    On overflow, return an extremal value; in particular, if time_t is
    an unsigned data type and D is negative, return zero.  Return the
    minimum EMACS_TIME if D is not a number.  */
-static inline EMACS_TIME
+SYSTIME_INLINE EMACS_TIME
 EMACS_TIME_FROM_DOUBLE (double d)
 {
   return dtotimespec (d);
 }
 
 /* Convert the Emacs time T to an approximate double value D.  */
-static inline double
+SYSTIME_INLINE double
 EMACS_TIME_TO_DOUBLE (EMACS_TIME t)
 {
   return timespectod (t);
@@ -155,35 +160,37 @@
 #endif
 
 /* Compare times T1 and T2 for equality, inequality etc.  */
-static inline int
+SYSTIME_INLINE int
 EMACS_TIME_EQ (EMACS_TIME t1, EMACS_TIME t2)
 {
   return timespec_cmp (t1, t2) == 0;
 }
-static inline int
+SYSTIME_INLINE int
 EMACS_TIME_NE (EMACS_TIME t1, EMACS_TIME t2)
 {
   return timespec_cmp (t1, t2) != 0;
 }
-static inline int
+SYSTIME_INLINE int
 EMACS_TIME_GT (EMACS_TIME t1, EMACS_TIME t2)
 {
   return timespec_cmp (t1, t2) > 0;
 }
-static inline int
+SYSTIME_INLINE int
 EMACS_TIME_GE (EMACS_TIME t1, EMACS_TIME t2)
 {
   return timespec_cmp (t1, t2) >= 0;
 }
-static inline int
+SYSTIME_INLINE int
 EMACS_TIME_LT (EMACS_TIME t1, EMACS_TIME t2)
 {
   return timespec_cmp (t1, t2) < 0;
 }
-static inline int
+SYSTIME_INLINE int
 EMACS_TIME_LE (EMACS_TIME t1, EMACS_TIME t2)
 {
   return timespec_cmp (t1, t2) <= 0;
 }
 
+INLINE_HEADER_END
+
 #endif /* EMACS_SYSTIME_H */


reply via email to

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