* 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.
+2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
+
+ Use C99-style 'extern inline' if available.
+ * profile.c (SYSTIME_INLINE): Define.
+
2012-08-02 Glenn Morris <rgm@gnu.org>
* makefile.w32-in (MS_W32_H): Update for new ms-w32.h location.
*/
#include <config.h>
+#define SYSTIME_INLINE EXTERN_INLINE
+
#include <inttypes.h>
#include <stdio.h>
+2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
+
+ 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 <rgm@gnu.org>
* inc/ms-w32.h: Move here from ../src/s.
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))
+2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
+
+ 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 <rgm@gnu.org>
* s/: Remove empty directory.
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>
#include <config.h>
+#define BUFFER_INLINE EXTERN_INLINE
+
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/param.h>
#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
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)
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
(*(Lisp_Object *)((OFFSET) + (char *) (BUFFER)))
\f
/* 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);
}
/* 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);
}
/* 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
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"
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) \
>> ((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);
&& word_boundary_p (c1, c2))
extern int word_boundary_p (int, int);
+
+INLINE_HEADER_END
#include <config.h>
#endif
+#define CHARACTER_INLINE EXTERN_INLINE
+
#include <stdio.h>
#ifdef emacs
#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
#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;
/* 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;
#define GET_TRANSLATION_TABLE(id) \
(XCDR(XVECTOR(Vtranslation_table_vector)->contents[(id)]))
+INLINE_HEADER_END
+
#endif /* EMACS_CHARACTER_H */
#include <config.h>
+#define CHARSET_INLINE EXTERN_INLINE
+
#include <stdio.h>
#include <unistd.h>
#include <ctype.h>
#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
#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)
{
Lisp_Object, Lisp_Object,
struct charset *, unsigned, unsigned);
+INLINE_HEADER_END
+
#endif /* EMACS_CHARSET_H */
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"
#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. */
#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);
extern ptrdiff_t composition_adjust_point (ptrdiff_t, ptrdiff_t);
+INLINE_HEADER_END
+
#endif /* not EMACS_COMPOSITE_H */
#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 */
#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);
#endif /* HAVE_WINDOW_SYSTEM */
+INLINE_HEADER_END
+
#endif /* not DISPEXTERN_H_INCLUDED */
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>
#include <intprops.h>
+INLINE_HEADER_BEGIN
+#ifndef LISP_INLINE
+# define LISP_INLINE INLINE
+#endif
+
/* The ubiquitous max and min macros. */
#undef min
#undef max
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;
/* 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
#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;
/* 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);
/* 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));
/* 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));
/* 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));
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));
/* 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
Fgarbage_collect ();
}
+INLINE_HEADER_END
+
#endif /* EMACS_LISP_H */
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>
#include <timespec.h>
+INLINE_HEADER_BEGIN
+#ifndef SYSTIME_INLINE
+# define SYSTIME_INLINE INLINE
+#endif
+
#ifdef emacs
# ifdef HAVE_X_WINDOWS
# include <X11/X.h>
/* 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 };
}
/* Return an invalid Emacs time. */
-static inline EMACS_TIME
+SYSTIME_INLINE EMACS_TIME
invalid_emacs_time (void)
{
EMACS_TIME r = { 0, -1 };
}
/* Return current system time. */
-static inline EMACS_TIME
+SYSTIME_INLINE EMACS_TIME
current_emacs_time (void)
{
EMACS_TIME r;
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);
/* 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;
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);
#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 */