inline and glib.h (was Re: ObjC and `glib.h')



Elliot Lee <sopwith@redhat.com> writes:

> Yes, 'id' is a reserved word. When naming functions/parameters/variables,
> people might want to keep in mind the reserved words of ObjC and C++, both
> of which can include C headers directly (instead of requiring wrappers
> like, say, scheme).

Speaking of which, there is a similar problem with glib.h :

#else /* !G_HAVE_INLINE */
#  undef inline
#  if defined (G_HAVE___INLINE__)
#    define inline __inline__
#  else /* !inline && !__inline__ */
#    if defined (G_HAVE___INLINE)
#      define inline __inline
#    else /* !inline && !__inline__ && !__inline */
#      define inline /* don't inline, then */	<---- potential trouble here
#      ifndef G_INLINE_FUNC
#	 undef G_CAN_INLINE

It seems trouble would occur if glib is configured for a C compiler
which absolutely does not understand "inline", and glib.h is included
from C++.

-- 
					Guillaume.
					http://www.worldnet.fr/~glaurent



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