This is the mail archive of the guile@cygnus.com mailing list for the guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: guile: going the way of DEATH


On 980814, Jim Blandy wrote:
> So the definitions in the header file need to be `inline' and
> `extern', while the definitions in the library need to be ordinary.
> Oh, and you have to make sure all this works properly when you're not
> using GCC.  Sounds like a case for some serious CPP grunging.

inline.h:

#ifndef INLINE
#if defined(GCC) /* && major > 2 || (major == 2 && minor >= 7), or whenever inlines started being supported well */
#define INLINE inline extern 
#endif
#endif

#ifdef INLINE
inline exterm void 
func(void)
{
    /* body */
}
#else
/* For non-inlining compilers */
extern void func(void);
#endif


inline.c:
#define INLINE
#include "inline.h"
#undef INLINE


Not TOO bad, I don't think.