mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-19 23:28:54 +02:00
2005-01-04 Matthias Clasen <mclasen@redhat.com> Fix the inlining magic. (#157536, Jens Hatlak, and #149907, Morten Welinder) * configure.in: Define G_CAN_INLINE in glibconfig.h * glib/gutils.h: Streamline the inlining magic a bit, don't use extern when implementing the non-inlined version.
This commit is contained in:
committed by
Matthias Clasen
parent
f0630a9106
commit
44fea2aa61
11
ChangeLog
11
ChangeLog
@@ -1,3 +1,14 @@
|
|||||||
|
2005-01-04 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
|
Fix the inlining magic. (#157536, Jens Hatlak, and
|
||||||
|
#149907, Morten Welinder)
|
||||||
|
|
||||||
|
* configure.in: Define G_CAN_INLINE in glibconfig.h
|
||||||
|
|
||||||
|
* glib/gutils.h: Streamline the inlining magic a bit,
|
||||||
|
don't use extern when implementing the non-inlined
|
||||||
|
version.
|
||||||
|
|
||||||
2005-01-03 Matthias Clasen <mclasen@redhat.com>
|
2005-01-03 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
* glib/gutils.c (g_find_program_in_path): Don't return
|
* glib/gutils.c (g_find_program_in_path): Don't return
|
||||||
|
|||||||
@@ -1,3 +1,14 @@
|
|||||||
|
2005-01-04 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
|
Fix the inlining magic. (#157536, Jens Hatlak, and
|
||||||
|
#149907, Morten Welinder)
|
||||||
|
|
||||||
|
* configure.in: Define G_CAN_INLINE in glibconfig.h
|
||||||
|
|
||||||
|
* glib/gutils.h: Streamline the inlining magic a bit,
|
||||||
|
don't use extern when implementing the non-inlined
|
||||||
|
version.
|
||||||
|
|
||||||
2005-01-03 Matthias Clasen <mclasen@redhat.com>
|
2005-01-03 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
* glib/gutils.c (g_find_program_in_path): Don't return
|
* glib/gutils.c (g_find_program_in_path): Don't return
|
||||||
|
|||||||
@@ -1,3 +1,14 @@
|
|||||||
|
2005-01-04 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
|
Fix the inlining magic. (#157536, Jens Hatlak, and
|
||||||
|
#149907, Morten Welinder)
|
||||||
|
|
||||||
|
* configure.in: Define G_CAN_INLINE in glibconfig.h
|
||||||
|
|
||||||
|
* glib/gutils.h: Streamline the inlining magic a bit,
|
||||||
|
don't use extern when implementing the non-inlined
|
||||||
|
version.
|
||||||
|
|
||||||
2005-01-03 Matthias Clasen <mclasen@redhat.com>
|
2005-01-03 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
* glib/gutils.c (g_find_program_in_path): Don't return
|
* glib/gutils.c (g_find_program_in_path): Don't return
|
||||||
|
|||||||
@@ -1,3 +1,14 @@
|
|||||||
|
2005-01-04 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
|
Fix the inlining magic. (#157536, Jens Hatlak, and
|
||||||
|
#149907, Morten Welinder)
|
||||||
|
|
||||||
|
* configure.in: Define G_CAN_INLINE in glibconfig.h
|
||||||
|
|
||||||
|
* glib/gutils.h: Streamline the inlining magic a bit,
|
||||||
|
don't use extern when implementing the non-inlined
|
||||||
|
version.
|
||||||
|
|
||||||
2005-01-03 Matthias Clasen <mclasen@redhat.com>
|
2005-01-03 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
* glib/gutils.c (g_find_program_in_path): Don't return
|
* glib/gutils.c (g_find_program_in_path): Don't return
|
||||||
|
|||||||
@@ -1,3 +1,14 @@
|
|||||||
|
2005-01-04 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
|
Fix the inlining magic. (#157536, Jens Hatlak, and
|
||||||
|
#149907, Morten Welinder)
|
||||||
|
|
||||||
|
* configure.in: Define G_CAN_INLINE in glibconfig.h
|
||||||
|
|
||||||
|
* glib/gutils.h: Streamline the inlining magic a bit,
|
||||||
|
don't use extern when implementing the non-inlined
|
||||||
|
version.
|
||||||
|
|
||||||
2005-01-03 Matthias Clasen <mclasen@redhat.com>
|
2005-01-03 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
* glib/gutils.c (g_find_program_in_path): Don't return
|
* glib/gutils.c (g_find_program_in_path): Don't return
|
||||||
|
|||||||
43
configure.in
43
configure.in
@@ -662,6 +662,34 @@ case x$glib_cv_hasinline in
|
|||||||
xyes) AC_DEFINE(G_HAVE_INLINE,1,[Have inline keyword])
|
xyes) AC_DEFINE(G_HAVE_INLINE,1,[Have inline keyword])
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
# if we can use inline functions in headers
|
||||||
|
AC_MSG_CHECKING(if inline functions in headers work)
|
||||||
|
AC_LINK_IFELSE([
|
||||||
|
#if defined (G_HAVE_INLINE) && defined (__GNUC__) && defined (__STRICT_ANSI__)
|
||||||
|
# undef inline
|
||||||
|
# define inline __inline__
|
||||||
|
#elif !defined (G_HAVE_INLINE)
|
||||||
|
# undef inline
|
||||||
|
# if defined (G_HAVE___INLINE__)
|
||||||
|
# define inline __inline__
|
||||||
|
# elif defined (G_HAVE___INLINE)
|
||||||
|
# define inline __inline
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
int glib_test_func2 (int);
|
||||||
|
|
||||||
|
static inline int
|
||||||
|
glib_test_func1 (void) {
|
||||||
|
return glib_test_func2 (1);
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
main (void) {
|
||||||
|
int i = 1;
|
||||||
|
}],[g_can_inline=yes],[g_can_inline=no])
|
||||||
|
AC_MSG_RESULT($g_can_inline)
|
||||||
|
|
||||||
# check for flavours of varargs macros
|
# check for flavours of varargs macros
|
||||||
AC_MSG_CHECKING(for ISO C99 varargs macros in C)
|
AC_MSG_CHECKING(for ISO C99 varargs macros in C)
|
||||||
AC_TRY_COMPILE([],[
|
AC_TRY_COMPILE([],[
|
||||||
@@ -2212,6 +2240,20 @@ $glib_vacopy
|
|||||||
$glib_inline
|
$glib_inline
|
||||||
#endif /* !__cplusplus */
|
#endif /* !__cplusplus */
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
#define G_CAN_INLINE 1
|
||||||
|
_______EOF
|
||||||
|
|
||||||
|
if test x$g_can_inline = xyes ; then
|
||||||
|
cat >>$outfile <<_______EOF
|
||||||
|
#else /* !__cplusplus */
|
||||||
|
#define G_CAN_INLINE 1
|
||||||
|
_______EOF
|
||||||
|
fi
|
||||||
|
|
||||||
|
cat >>$outfile <<_______EOF
|
||||||
|
#endif
|
||||||
|
|
||||||
_______EOF
|
_______EOF
|
||||||
|
|
||||||
if test x$g_have_iso_c_varargs = xyes ; then
|
if test x$g_have_iso_c_varargs = xyes ; then
|
||||||
@@ -2591,6 +2633,7 @@ g_have_gnuc_varargs=$g_have_gnuc_varargs
|
|||||||
g_have_iso_c_varargs=$g_have_iso_c_varargs
|
g_have_iso_c_varargs=$g_have_iso_c_varargs
|
||||||
g_have_iso_cxx_varargs=$g_have_iso_cxx_varargs
|
g_have_iso_cxx_varargs=$g_have_iso_cxx_varargs
|
||||||
|
|
||||||
|
g_can_inline=$g_can_inline
|
||||||
g_have_gnuc_visibility=$g_have_gnuc_visibility
|
g_have_gnuc_visibility=$g_have_gnuc_visibility
|
||||||
|
|
||||||
case xyes in
|
case xyes in
|
||||||
|
|||||||
@@ -71,21 +71,14 @@ G_BEGIN_DECLS
|
|||||||
/* inlining hassle. for compilers that don't allow the `inline' keyword,
|
/* inlining hassle. for compilers that don't allow the `inline' keyword,
|
||||||
* mostly because of strict ANSI C compliance or dumbness, we try to fall
|
* mostly because of strict ANSI C compliance or dumbness, we try to fall
|
||||||
* back to either `__inline__' or `__inline'.
|
* back to either `__inline__' or `__inline'.
|
||||||
* we define G_CAN_INLINE, if the compiler seems to be actually
|
* G_CAN_INLINE is defined in glibconfig.h if the compiler seems to be
|
||||||
* *capable* to do function inlining, in which case inline function bodys
|
* actually *capable* to do function inlining, in which case inline
|
||||||
* do make sense. we also define G_INLINE_FUNC to properly export the
|
* function bodies do make sense. we also define G_INLINE_FUNC to properly
|
||||||
* function prototypes if no inlining can be performed.
|
* export the function prototypes if no inlining can be performed.
|
||||||
* inline function bodies have to be special cased with G_CAN_INLINE and a
|
* inline function bodies have to be special cased with G_CAN_INLINE and a
|
||||||
* .c file specific macro to allow one compiled instance with extern linkage
|
* .c file specific macro to allow one compiled instance with extern linkage
|
||||||
* of the functions by defining G_IMPLEMENT_INLINES and the .c file macro.
|
* of the functions by defining G_IMPLEMENT_INLINES and the .c file macro.
|
||||||
*/
|
*/
|
||||||
#ifdef G_IMPLEMENT_INLINES
|
|
||||||
# define G_INLINE_FUNC extern
|
|
||||||
# undef G_CAN_INLINE
|
|
||||||
#endif
|
|
||||||
#ifndef G_INLINE_FUNC
|
|
||||||
# define G_CAN_INLINE 1
|
|
||||||
#endif
|
|
||||||
#if defined (G_HAVE_INLINE) && defined (__GNUC__) && defined (__STRICT_ANSI__)
|
#if defined (G_HAVE_INLINE) && defined (__GNUC__) && defined (__STRICT_ANSI__)
|
||||||
# undef inline
|
# undef inline
|
||||||
# define inline __inline__
|
# define inline __inline__
|
||||||
@@ -97,20 +90,16 @@ G_BEGIN_DECLS
|
|||||||
# define inline __inline
|
# define inline __inline
|
||||||
# else /* !inline && !__inline__ && !__inline */
|
# else /* !inline && !__inline__ && !__inline */
|
||||||
# define inline /* don't inline, then */
|
# define inline /* don't inline, then */
|
||||||
# ifndef G_INLINE_FUNC
|
|
||||||
# undef G_CAN_INLINE
|
|
||||||
# endif
|
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
#ifndef G_INLINE_FUNC
|
#ifdef G_IMPLEMENT_INLINES
|
||||||
# if defined (__GNUC__) && defined (__OPTIMIZE__)
|
# define G_INLINE_FUNC
|
||||||
# define G_INLINE_FUNC extern inline
|
#elif defined (__GNUC__) && defined (__OPTIMIZE__)
|
||||||
# elif defined (G_CAN_INLINE) && !defined (__GNUC__)
|
# define G_INLINE_FUNC extern inline
|
||||||
# define G_INLINE_FUNC static inline
|
#elif defined (G_CAN_INLINE) && !defined (__GNUC__)
|
||||||
# else /* can't inline */
|
# define G_INLINE_FUNC static inline
|
||||||
# define G_INLINE_FUNC extern
|
#else /* can't inline */
|
||||||
# undef G_CAN_INLINE
|
# define G_INLINE_FUNC
|
||||||
# endif
|
|
||||||
#endif /* !G_INLINE_FUNC */
|
#endif /* !G_INLINE_FUNC */
|
||||||
|
|
||||||
/* Retrive static string info
|
/* Retrive static string info
|
||||||
|
|||||||
Reference in New Issue
Block a user