[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#12116: merge from gnulib for extern-inline
From: |
Eli Zaretskii |
Subject: |
bug#12116: merge from gnulib for extern-inline |
Date: |
Thu, 02 Aug 2012 22:49:37 +0300 |
> Date: Thu, 02 Aug 2012 11:02:59 -0700
> From: Paul Eggert <eggert@cs.ucla.edu>
> CC: 12116@debbugs.gnu.org, lekktu@gmail.com
>
> e x p a n s i o n i n :
> macro C99 older compilers ancient compilers
> INLINE inline static inline static
> EXTERN_INLINE extern inline static inline static
>
> and the Emacs include file charset.h does this:
>
> #ifndef CHARSET_INLINE
> # define CHARSET_INLINE INLINE
> #endif
>
> CHARSET_INLINE void
> set_charset_attr (struct charset *charset, enum charset_attr_index idx,
> Lisp_Object val)
> {
> ASET (CHARSET_ATTRIBUTES (charset), idx, val);
> }
>
> so in C99 most users of charset.h see the function as being
> 'inline void'. charset.c does this before including charset.h:
>
> #define CHARSET_INLINE EXTERN_INLINE
>
> so that when it's compiled, the function is 'extern inline void'.
> In pre-C99 compilers the function is 'static inline' or (if ancient)
> plain 'static'. Similarly for each .h file that uses inline functions.
OK, but what's the story with the addition of stat-time.c,
utimespec.c, and u64.c, which just include the respective headers?
Where and how are these used, and for what purposes?
I understood the extern inline stuff, I just don't get why are these
*.c files introduced.