"Kirill 'Big K' Katsnelson" <kkm(a)dtmx.com> writes:
Some time ago, Andy Piper wrote...
> * redisplay-msw.c (get_frame_compdc): gcc can't cope with this
> inline.
> (get_frame_dc): ditto.
Could you please then conditionalize this on kind of
BROKEN_GCC_INLINE? Finally, if INLINE does not work with gcc why is
not it defined to static?
Beware, INLINE in XEmacs is not what you might think it is. Maybe
this is how Andy got burned.
#ifndef NOT_C_CODE
#ifdef __cplusplus
#define HAVE_INLINE 1
#define INLINE inline
#else /* not C++ */
/* Does the keyword `inline' exist? */
#undef HAVE_INLINE
#undef inline
# ifdef HAVE_INLINE
# ifdef __GNUC__
# ifdef DONT_EXTERN_INLINE_FUNCTIONS
# define INLINE inline
# else
# define INLINE extern inline
# endif
# else
# define INLINE static inline
# endif /* __GNUC__ */
# else
# define INLINE static
# endif /* HAVE_INLINE */
#endif /* not C++ */
#endif /* C code */
Notice how in almost all files INLINE is #defined to _extern_ inline,
not to static or static inline as one would assume. This is so that
the inline functions defined in headers work right.
I think we should change it so that:
* we rename existing INLINE to HEADER_INLINE, so that at least the
name suggests what's going on.
* we introduce a "real" INLINE macro that does the right thing in C
sources. INLINE would expand to `inline' in Gcc (and other
compilers that support inline the same way), `static inline' in C++,
and to nothing otherwise.