1
0
mirror of https://gitlab.gnome.org/GNOME/glib.git synced 2025-05-30 09:20:07 +02:00

check for all three inline keywords individually.

Mon Sep  7 07:53:21 1998  Tim Janik  <timj@gtk.org>

        * configure.in: check for all three inline keywords individually.

        * glib.h: inlining hassle. for compilers that don't allow the `inline'
        keyword, mostly because of strict ANSI C compliance or dumbness, we try
        to fall back to either `__inline__' or `__inline'.
        we define G_CAN_INLINE, if the compiler seems to be actually *capable*
        to do function inlining, in which case inline function bodys do make
        sense. we also define G_INLINE_FUNC to properly export the function
        prototypes if no inlinig can be performed. we special case most of the
        stuff, so inline functions can have a normal implementation by defining
        G_INLINE_FUNC to extern and G_CAN_INLINE to 1.

        * ltconfig: (compiler PIC flag test): special case linux for non
        aout systems to honour lcc's position independant code (cases
        "linux*aout)" and "linux*)" got added). (this needs to go into
        libtool which does an advanced test, checking for __LCC__).

        * autogen.sh: take $CC=lcc into account by invoking automake with
        --include-deps so lcc isn't scared by gcc's auto-dependancy
        generation code. care about $ACLOCAL_FLAGS. optionally feature
        autoheader.

        * minor fixups in other places to cure some of lcc's warnings.
This commit is contained in:
Tim Janik 1998-09-07 09:43:54 +00:00 committed by Tim Janik
parent affa6a0677
commit 0b42c37e7d
25 changed files with 484 additions and 131 deletions

@ -1,3 +1,29 @@
Mon Sep 7 07:53:21 1998 Tim Janik <timj@gtk.org>
* configure.in: check for all three inline keywords individually.
* glib.h: inlining hassle. for compilers that don't allow the `inline'
keyword, mostly because of strict ANSI C compliance or dumbness, we try
to fall back to either `__inline__' or `__inline'.
we define G_CAN_INLINE, if the compiler seems to be actually *capable*
to do function inlining, in which case inline function bodys do make
sense. we also define G_INLINE_FUNC to properly export the function
prototypes if no inlinig can be performed. we special case most of the
stuff, so inline functions can have a normal implementation by defining
G_INLINE_FUNC to extern and G_CAN_INLINE to 1.
* ltconfig: (compiler PIC flag test): special case linux for non
aout systems to honour lcc's position independant code (cases
"linux*aout)" and "linux*)" got added). (this needs to go into
libtool which does an advanced test, checking for __LCC__).
* autogen.sh: take $CC=lcc into account by invoking automake with
--include-deps so lcc isn't scared by gcc's auto-dependancy
generation code. care about $ACLOCAL_FLAGS. optionally feature
autoheader.
* minor fixups in other places to cure some of lcc's warnings.
Sun Sep 6 19:08:53 PDT 1998 Manish Singh <yosh@gimp.org> Sun Sep 6 19:08:53 PDT 1998 Manish Singh <yosh@gimp.org>
* configure.in: added -std1 check for ANSI compliance (from gtk) * configure.in: added -std1 check for ANSI compliance (from gtk)

@ -1,3 +1,29 @@
Mon Sep 7 07:53:21 1998 Tim Janik <timj@gtk.org>
* configure.in: check for all three inline keywords individually.
* glib.h: inlining hassle. for compilers that don't allow the `inline'
keyword, mostly because of strict ANSI C compliance or dumbness, we try
to fall back to either `__inline__' or `__inline'.
we define G_CAN_INLINE, if the compiler seems to be actually *capable*
to do function inlining, in which case inline function bodys do make
sense. we also define G_INLINE_FUNC to properly export the function
prototypes if no inlinig can be performed. we special case most of the
stuff, so inline functions can have a normal implementation by defining
G_INLINE_FUNC to extern and G_CAN_INLINE to 1.
* ltconfig: (compiler PIC flag test): special case linux for non
aout systems to honour lcc's position independant code (cases
"linux*aout)" and "linux*)" got added). (this needs to go into
libtool which does an advanced test, checking for __LCC__).
* autogen.sh: take $CC=lcc into account by invoking automake with
--include-deps so lcc isn't scared by gcc's auto-dependancy
generation code. care about $ACLOCAL_FLAGS. optionally feature
autoheader.
* minor fixups in other places to cure some of lcc's warnings.
Sun Sep 6 19:08:53 PDT 1998 Manish Singh <yosh@gimp.org> Sun Sep 6 19:08:53 PDT 1998 Manish Singh <yosh@gimp.org>
* configure.in: added -std1 check for ANSI compliance (from gtk) * configure.in: added -std1 check for ANSI compliance (from gtk)

@ -1,3 +1,29 @@
Mon Sep 7 07:53:21 1998 Tim Janik <timj@gtk.org>
* configure.in: check for all three inline keywords individually.
* glib.h: inlining hassle. for compilers that don't allow the `inline'
keyword, mostly because of strict ANSI C compliance or dumbness, we try
to fall back to either `__inline__' or `__inline'.
we define G_CAN_INLINE, if the compiler seems to be actually *capable*
to do function inlining, in which case inline function bodys do make
sense. we also define G_INLINE_FUNC to properly export the function
prototypes if no inlinig can be performed. we special case most of the
stuff, so inline functions can have a normal implementation by defining
G_INLINE_FUNC to extern and G_CAN_INLINE to 1.
* ltconfig: (compiler PIC flag test): special case linux for non
aout systems to honour lcc's position independant code (cases
"linux*aout)" and "linux*)" got added). (this needs to go into
libtool which does an advanced test, checking for __LCC__).
* autogen.sh: take $CC=lcc into account by invoking automake with
--include-deps so lcc isn't scared by gcc's auto-dependancy
generation code. care about $ACLOCAL_FLAGS. optionally feature
autoheader.
* minor fixups in other places to cure some of lcc's warnings.
Sun Sep 6 19:08:53 PDT 1998 Manish Singh <yosh@gimp.org> Sun Sep 6 19:08:53 PDT 1998 Manish Singh <yosh@gimp.org>
* configure.in: added -std1 check for ANSI compliance (from gtk) * configure.in: added -std1 check for ANSI compliance (from gtk)

@ -1,3 +1,29 @@
Mon Sep 7 07:53:21 1998 Tim Janik <timj@gtk.org>
* configure.in: check for all three inline keywords individually.
* glib.h: inlining hassle. for compilers that don't allow the `inline'
keyword, mostly because of strict ANSI C compliance or dumbness, we try
to fall back to either `__inline__' or `__inline'.
we define G_CAN_INLINE, if the compiler seems to be actually *capable*
to do function inlining, in which case inline function bodys do make
sense. we also define G_INLINE_FUNC to properly export the function
prototypes if no inlinig can be performed. we special case most of the
stuff, so inline functions can have a normal implementation by defining
G_INLINE_FUNC to extern and G_CAN_INLINE to 1.
* ltconfig: (compiler PIC flag test): special case linux for non
aout systems to honour lcc's position independant code (cases
"linux*aout)" and "linux*)" got added). (this needs to go into
libtool which does an advanced test, checking for __LCC__).
* autogen.sh: take $CC=lcc into account by invoking automake with
--include-deps so lcc isn't scared by gcc's auto-dependancy
generation code. care about $ACLOCAL_FLAGS. optionally feature
autoheader.
* minor fixups in other places to cure some of lcc's warnings.
Sun Sep 6 19:08:53 PDT 1998 Manish Singh <yosh@gimp.org> Sun Sep 6 19:08:53 PDT 1998 Manish Singh <yosh@gimp.org>
* configure.in: added -std1 check for ANSI compliance (from gtk) * configure.in: added -std1 check for ANSI compliance (from gtk)

@ -1,3 +1,29 @@
Mon Sep 7 07:53:21 1998 Tim Janik <timj@gtk.org>
* configure.in: check for all three inline keywords individually.
* glib.h: inlining hassle. for compilers that don't allow the `inline'
keyword, mostly because of strict ANSI C compliance or dumbness, we try
to fall back to either `__inline__' or `__inline'.
we define G_CAN_INLINE, if the compiler seems to be actually *capable*
to do function inlining, in which case inline function bodys do make
sense. we also define G_INLINE_FUNC to properly export the function
prototypes if no inlinig can be performed. we special case most of the
stuff, so inline functions can have a normal implementation by defining
G_INLINE_FUNC to extern and G_CAN_INLINE to 1.
* ltconfig: (compiler PIC flag test): special case linux for non
aout systems to honour lcc's position independant code (cases
"linux*aout)" and "linux*)" got added). (this needs to go into
libtool which does an advanced test, checking for __LCC__).
* autogen.sh: take $CC=lcc into account by invoking automake with
--include-deps so lcc isn't scared by gcc's auto-dependancy
generation code. care about $ACLOCAL_FLAGS. optionally feature
autoheader.
* minor fixups in other places to cure some of lcc's warnings.
Sun Sep 6 19:08:53 PDT 1998 Manish Singh <yosh@gimp.org> Sun Sep 6 19:08:53 PDT 1998 Manish Singh <yosh@gimp.org>
* configure.in: added -std1 check for ANSI compliance (from gtk) * configure.in: added -std1 check for ANSI compliance (from gtk)

@ -1,3 +1,29 @@
Mon Sep 7 07:53:21 1998 Tim Janik <timj@gtk.org>
* configure.in: check for all three inline keywords individually.
* glib.h: inlining hassle. for compilers that don't allow the `inline'
keyword, mostly because of strict ANSI C compliance or dumbness, we try
to fall back to either `__inline__' or `__inline'.
we define G_CAN_INLINE, if the compiler seems to be actually *capable*
to do function inlining, in which case inline function bodys do make
sense. we also define G_INLINE_FUNC to properly export the function
prototypes if no inlinig can be performed. we special case most of the
stuff, so inline functions can have a normal implementation by defining
G_INLINE_FUNC to extern and G_CAN_INLINE to 1.
* ltconfig: (compiler PIC flag test): special case linux for non
aout systems to honour lcc's position independant code (cases
"linux*aout)" and "linux*)" got added). (this needs to go into
libtool which does an advanced test, checking for __LCC__).
* autogen.sh: take $CC=lcc into account by invoking automake with
--include-deps so lcc isn't scared by gcc's auto-dependancy
generation code. care about $ACLOCAL_FLAGS. optionally feature
autoheader.
* minor fixups in other places to cure some of lcc's warnings.
Sun Sep 6 19:08:53 PDT 1998 Manish Singh <yosh@gimp.org> Sun Sep 6 19:08:53 PDT 1998 Manish Singh <yosh@gimp.org>
* configure.in: added -std1 check for ANSI compliance (from gtk) * configure.in: added -std1 check for ANSI compliance (from gtk)

@ -1,3 +1,29 @@
Mon Sep 7 07:53:21 1998 Tim Janik <timj@gtk.org>
* configure.in: check for all three inline keywords individually.
* glib.h: inlining hassle. for compilers that don't allow the `inline'
keyword, mostly because of strict ANSI C compliance or dumbness, we try
to fall back to either `__inline__' or `__inline'.
we define G_CAN_INLINE, if the compiler seems to be actually *capable*
to do function inlining, in which case inline function bodys do make
sense. we also define G_INLINE_FUNC to properly export the function
prototypes if no inlinig can be performed. we special case most of the
stuff, so inline functions can have a normal implementation by defining
G_INLINE_FUNC to extern and G_CAN_INLINE to 1.
* ltconfig: (compiler PIC flag test): special case linux for non
aout systems to honour lcc's position independant code (cases
"linux*aout)" and "linux*)" got added). (this needs to go into
libtool which does an advanced test, checking for __LCC__).
* autogen.sh: take $CC=lcc into account by invoking automake with
--include-deps so lcc isn't scared by gcc's auto-dependancy
generation code. care about $ACLOCAL_FLAGS. optionally feature
autoheader.
* minor fixups in other places to cure some of lcc's warnings.
Sun Sep 6 19:08:53 PDT 1998 Manish Singh <yosh@gimp.org> Sun Sep 6 19:08:53 PDT 1998 Manish Singh <yosh@gimp.org>
* configure.in: added -std1 check for ANSI compliance (from gtk) * configure.in: added -std1 check for ANSI compliance (from gtk)

@ -1,3 +1,29 @@
Mon Sep 7 07:53:21 1998 Tim Janik <timj@gtk.org>
* configure.in: check for all three inline keywords individually.
* glib.h: inlining hassle. for compilers that don't allow the `inline'
keyword, mostly because of strict ANSI C compliance or dumbness, we try
to fall back to either `__inline__' or `__inline'.
we define G_CAN_INLINE, if the compiler seems to be actually *capable*
to do function inlining, in which case inline function bodys do make
sense. we also define G_INLINE_FUNC to properly export the function
prototypes if no inlinig can be performed. we special case most of the
stuff, so inline functions can have a normal implementation by defining
G_INLINE_FUNC to extern and G_CAN_INLINE to 1.
* ltconfig: (compiler PIC flag test): special case linux for non
aout systems to honour lcc's position independant code (cases
"linux*aout)" and "linux*)" got added). (this needs to go into
libtool which does an advanced test, checking for __LCC__).
* autogen.sh: take $CC=lcc into account by invoking automake with
--include-deps so lcc isn't scared by gcc's auto-dependancy
generation code. care about $ACLOCAL_FLAGS. optionally feature
autoheader.
* minor fixups in other places to cure some of lcc's warnings.
Sun Sep 6 19:08:53 PDT 1998 Manish Singh <yosh@gimp.org> Sun Sep 6 19:08:53 PDT 1998 Manish Singh <yosh@gimp.org>
* configure.in: added -std1 check for ANSI compliance (from gtk) * configure.in: added -std1 check for ANSI compliance (from gtk)

@ -64,6 +64,9 @@
#undef G_VA_COPY #undef G_VA_COPY
#undef G_VA_COPY_AS_ARRAY #undef G_VA_COPY_AS_ARRAY
#undef G_HAVE___INLINE
#undef G_HAVE___INLINE__
#undef G_HAVE_INLINE
#undef GLIB_MAJOR_VERSION #undef GLIB_MAJOR_VERSION
#undef GLIB_MINOR_VERSION #undef GLIB_MINOR_VERSION
@ -74,6 +77,8 @@
/* #undef PACKAGE */ /* #undef PACKAGE */
/* #undef VERSION */ /* #undef VERSION */
/* Leave that blank line there!! Autoheader needs it. /* Leave that blank line there!! Autoheader needs it.
If you're adding to this file, keep in mind: If you're adding to this file, keep in mind:

@ -1,11 +1,15 @@
#!/bin/sh #!/bin/sh
# Run this to generate all the initial makefiles, etc. # Run this to generate all the initial makefiles, etc.
PROJECT=GLib
TEST_TYPE=-f
FILE=glib.h
DIE=0 DIE=0
(autoconf --version) < /dev/null > /dev/null 2>&1 || { (autoconf --version) < /dev/null > /dev/null 2>&1 || {
echo echo
echo "You must have autoconf installed to compile GLIB." echo "You must have autoconf installed to compile $PROJECT."
echo "Download the appropriate package for your distribution," echo "Download the appropriate package for your distribution,"
echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/" echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
DIE=1 DIE=1
@ -13,7 +17,7 @@ DIE=0
(libtool --version) < /dev/null > /dev/null 2>&1 || { (libtool --version) < /dev/null > /dev/null 2>&1 || {
echo echo
echo "You must have libtool installed to compile GLIB." echo "You must have libtool installed to compile $PROJECT."
echo "Get ftp://alpha.gnu.org/gnu/libtool-1.0h.tar.gz" echo "Get ftp://alpha.gnu.org/gnu/libtool-1.0h.tar.gz"
echo "(or a newer version if it is available)" echo "(or a newer version if it is available)"
DIE=1 DIE=1
@ -21,7 +25,7 @@ DIE=0
(automake --version) < /dev/null > /dev/null 2>&1 || { (automake --version) < /dev/null > /dev/null 2>&1 || {
echo echo
echo "You must have automake installed to compile GLIB." echo "You must have automake installed to compile $PROJECT."
echo "Get ftp://ftp.cygnus.com/pub/home/tromey/automake-1.2d.tar.gz" echo "Get ftp://ftp.cygnus.com/pub/home/tromey/automake-1.2d.tar.gz"
echo "(or a newer version if it is available)" echo "(or a newer version if it is available)"
DIE=1 DIE=1
@ -31,8 +35,8 @@ if test "$DIE" -eq 1; then
exit 1 exit 1
fi fi
test -f glib.h || { test $TEST_TYPE $FILE || {
echo "You must run this script in the top-level GLIB directory" echo "You must run this script in the top-level $PROJECT directory"
exit 1 exit 1
} }
@ -41,10 +45,17 @@ if test -z "$*"; then
echo "to pass any to it, please specify them on the $0 command line." echo "to pass any to it, please specify them on the $0 command line."
fi fi
aclocal case $CC in
automake *lcc | *lcc\ *) am_opt=--include-deps;;
esac
aclocal $ACLOCAL_FLAGS
automake $am_opt
autoconf autoconf
# optionally feature autoheader
(autoheader --version) < /dev/null > /dev/null 2>&1 && autoheader
./configure "$@" ./configure "$@"
echo echo
echo "Now type 'make' to compile GLIB." echo "Now type 'make' to compile $PROJECT."

@ -143,11 +143,61 @@ AC_CHECK_SIZEOF(int)
AC_CHECK_SIZEOF(void *) AC_CHECK_SIZEOF(void *)
AC_CHECK_SIZEOF(long long) AC_CHECK_SIZEOF(long long)
# long doubles were not used, and a portability problem dnl long doubles were not used, and a portability problem
# AC_C_LONG_DOUBLE dnl AC_C_LONG_DOUBLE
AC_C_CONST AC_C_CONST
AC_C_INLINE
dnl AC_C_INLINE is useless to us since it bails out too early, we need to
dnl truely know which ones of `inline', `__inline' and `__inline__' are
dnl actually supported.
AC_MSG_CHECKING(for __inline)
AC_CACHE_VAL(glib_cv_has__inline,[
AC_TRY_RUN([
__inline int foo () { return 0; }
int main () { return foo (); }
],
glib_cv_has__inline=yes
,
glib_cv_has__inline=no
,)
])
AC_MSG_RESULT($glib_cv_has__inline)
case x$glib_cv_has__inline in
yes) AC_DEFINE(G_HAVE___INLINE)
esac
AC_MSG_CHECKING(for __inline__)
AC_CACHE_VAL(glib_cv_has__inline__,[
AC_TRY_RUN([
__inline__ int foo () { return 0; }
int main () { return foo (); }
],
glib_cv_has__inline__=yes
,
glib_cv_has__inline__=no
,)
])
AC_MSG_RESULT($glib_cv_has__inline__)
case x$glib_cv_has__inline__ in
yes) AC_DEFINE(G_HAVE___INLINE__)
esac
AC_MSG_CHECKING(for inline)
AC_CACHE_VAL(glib_cv_hasinline,[
AC_TRY_RUN([
inline int foo () { return 0; }
int main () { return foo (); }
],
glib_cv_hasinline=yes
,
glib_cv_hasinline=no
,)
])
AC_MSG_RESULT($glib_cv_hasinline)
case x$glib_cv_hasinline in
yes) AC_DEFINE(G_HAVE_INLINE)
esac
dnl header file checks
AC_CHECK_HEADERS(float.h, AC_DEFINE(HAVE_FLOAT_H)) AC_CHECK_HEADERS(float.h, AC_DEFINE(HAVE_FLOAT_H))
AC_CHECK_HEADERS(limits.h, AC_DEFINE(HAVE_LIMITS_H)) AC_CHECK_HEADERS(limits.h, AC_DEFINE(HAVE_LIMITS_H))
AC_CHECK_HEADERS(values.h, AC_DEFINE(HAVE_VALUES_H)) AC_CHECK_HEADERS(values.h, AC_DEFINE(HAVE_VALUES_H))
@ -244,7 +294,8 @@ AC_MSG_RESULT($gtk_ok)
dnl ********************** dnl **********************
dnl *** va_copy checks *** dnl *** va_copy checks ***
dnl ********************** dnl **********************
dnl we currently check for all three cases, so we get all results in config.log dnl we currently check for all three va_copy possibilities, so we get
dnl all results in config.log for bug reports.
AC_MSG_CHECKING(for an implementation of va_copy()) AC_MSG_CHECKING(for an implementation of va_copy())
AC_CACHE_VAL(glib_cv_va_copy,[ AC_CACHE_VAL(glib_cv_va_copy,[
AC_TRY_RUN([ AC_TRY_RUN([

@ -178,7 +178,7 @@ static GMemChunk *ptr_array_mem_chunk = NULL;
GPtrArray* GPtrArray*
g_ptr_array_new () g_ptr_array_new (void)
{ {
GRealPtrArray *array; GRealPtrArray *array;

130
glib.h

@ -23,7 +23,7 @@
*/ */
#include <glibconfig.h> #include <glibconfig.h>
/* support standard arg inline functions for assertment macros /* include varargs functions for assertment macros
*/ */
#include <stdarg.h> #include <stdarg.h>
@ -95,6 +95,17 @@
#endif /* HAVE_VALUES_H */ #endif /* HAVE_VALUES_H */
/* the #pragma } statment is used to fix up emacs' c-mode which gets
* confused by extern "C" {. the ansi standard says that compilers
* have to ignore #pragma directives that they don't know about,
* so we should be save in using this.
*/
#ifdef __cplusplus
extern "C" {
#pragma }
#endif /* __cplusplus */
/* Provide definitions for some commonly used macros. /* Provide definitions for some commonly used macros.
* Some of them are only provided if they haven't already * Some of them are only provided if they haven't already
* been defined. It is assumed that if they are already * been defined. It is assumed that if they are already
@ -155,6 +166,57 @@
#endif /* G_CODE_GENERATION */ #endif /* G_CODE_GENERATION */
/* inlining hassle. for compilers that don't allow the `inline' keyword,
* mostly because of strict ANSI C compliance or dumbness, we try to fall
* back to either `__inline__' or `__inline'.
* we define G_CAN_INLINE, if the compiler seems to be actually
* *capable* to do function inlining, in which case inline function bodys
* do make sense. we also define G_INLINE_FUNC to properly export the
* function prototypes if no inlinig can be performed.
* we special case most of the stuff, so inline functions can have a normal
* implementation by defining G_INLINE_FUNC to extern and G_CAN_INLINE to 1.
*/
#ifndef G_INLINE_FUNC
# define G_CAN_INLINE 1
#endif
#ifdef G_HAVE_INLINE
# if defined (__GNUC__) && defined (__STRICT_ANSI__)
# undef inline
# define inline __inline__
# endif
#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 */
# ifndef G_INLINE_FUNC
# undef G_CAN_INLINE
# endif
# endif
# endif
#endif
#ifndef G_INLINE_FUNC
# ifdef __GNUC__
# ifdef __OPTIMIZE__
# define G_INLINE_FUNC extern inline
# else
# undef G_CAN_INLINE
# define G_INLINE_FUNC extern
# endif
# else /* !__GNUC__ */
# ifdef G_CAN_INLINE
# define G_INLINE_FUNC static inline
# else
# define G_INLINE_FUNC extern
# endif
# endif /* !__GNUC__ */
#endif /* !G_INLINE_FUNC */
/* Provide simple macro statement wrappers (adapted from Perl): /* Provide simple macro statement wrappers (adapted from Perl):
* G_STMT_START { statements; } G_STMT_END; * G_STMT_START { statements; } G_STMT_END;
* can be used as a single statement, as in * can be used as a single statement, as in
@ -180,31 +242,6 @@
#endif #endif
/* ANSI does not permit the keyword `inline'.
*/
#if defined (__STRICT_ANSI__)
# undef inline
# ifdef __GNUC__
# define inline __inline__
# else /* !__GNUC__ */
# define inline /* don't inline */
# endif /* !__GNUC__ */
#endif /* __STRICT_ANSI__ */
/* When using gcc we want to use `extern inline' to avoid random
* warnings with -Wall. */
#ifdef __GNUC__
/* We want to also have a non-inlined version of the function
* available. We implement this by redefining GLIB_INLINE in a glib
* implementation file. */
# ifndef GLIB_INLINE
# define GLIB_INLINE extern inline
# endif
#else
# undef GLIB_INLINE
# define GLIB_INLINE inline
#endif
/* Provide macros to feature the GCC function attribute. /* Provide macros to feature the GCC function attribute.
*/ */
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4) #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4)
@ -242,8 +279,8 @@
/* Hacker macro to place breakpoints for x86 machines. /* Hacker macro to place breakpoints for x86 machines.
* Actual use is strongly deprecated of course ;) * Actual use is strongly deprecated of course ;)
*/ */
#if defined (__i386__) #if defined (__i386__) && defined (__GNUC__)
#define G_BREAKPOINT() G_STMT_START{ __asm__ ("int $03"); }G_STMT_END #define G_BREAKPOINT() G_STMT_START{ __asm__ volatile ("int $03"); }G_STMT_END
#else /* !__i386__ */ #else /* !__i386__ */
#define G_BREAKPOINT() #define G_BREAKPOINT()
#endif /* __i386__ */ #endif /* __i386__ */
@ -423,17 +460,6 @@
#endif /* !G_DISABLE_CHECKS */ #endif /* !G_DISABLE_CHECKS */
#ifdef __cplusplus
/* the #pragma } statment is used to fix up emacs' c-mode which gets
* confused by extern "C" {. the ansi standard says that compilers
* have to ignore #pragma directives that they don't know about,
* so we should be save in using this.
*/
extern "C" {
#pragma }
#endif /* __cplusplus */
/* Provide type definitions for commonly used types. /* Provide type definitions for commonly used types.
* These are useful because a "gint8" can be adjusted * These are useful because a "gint8" can be adjusted
* to be 1 byte (8 bits) on all platforms. Similarly and * to be 1 byte (8 bits) on all platforms. Similarly and
@ -1212,19 +1238,12 @@ gchar* g_get_current_dir (void);
#endif #endif
/* Bit tests /* Bit tests
*/ */
G_INLINE_FUNC gint
/* Prototypes are required for inline functions to pacify gcc when
* some warnings are enabled. */
gint g_bit_nth_lsf (guint32 mask, gint nth_bit);
gint g_bit_nth_msf (guint32 mask, gint nth_bit);
guint g_bit_storage (guint number);
GLIB_INLINE gint
g_bit_nth_lsf (guint32 mask, g_bit_nth_lsf (guint32 mask,
gint nth_bit) gint nth_bit)
#ifdef G_CAN_INLINE
{ {
do do
{ {
@ -1235,9 +1254,13 @@ g_bit_nth_lsf (guint32 mask,
while (nth_bit < 32); while (nth_bit < 32);
return -1; return -1;
} }
GLIB_INLINE gint #else
;
#endif
G_INLINE_FUNC gint
g_bit_nth_msf (guint32 mask, g_bit_nth_msf (guint32 mask,
gint nth_bit) gint nth_bit)
#ifdef G_CAN_INLINE
{ {
if (nth_bit < 0) if (nth_bit < 0)
nth_bit = 33; nth_bit = 33;
@ -1250,8 +1273,12 @@ g_bit_nth_msf (guint32 mask,
while (nth_bit > 0); while (nth_bit > 0);
return -1; return -1;
} }
GLIB_INLINE guint #else
;
#endif
G_INLINE_FUNC guint
g_bit_storage (guint number) g_bit_storage (guint number)
#ifdef G_CAN_INLINE
{ {
register guint n_bits = 0; register guint n_bits = 0;
@ -1262,6 +1289,9 @@ g_bit_storage (guint number)
} while (number); } while (number);
return n_bits; return n_bits;
} }
#else
;
#endif
/* String Chunks /* String Chunks

@ -178,7 +178,7 @@ static GMemChunk *ptr_array_mem_chunk = NULL;
GPtrArray* GPtrArray*
g_ptr_array_new () g_ptr_array_new (void)
{ {
GRealPtrArray *array; GRealPtrArray *array;

@ -23,7 +23,7 @@
*/ */
#include <glibconfig.h> #include <glibconfig.h>
/* support standard arg inline functions for assertment macros /* include varargs functions for assertment macros
*/ */
#include <stdarg.h> #include <stdarg.h>
@ -95,6 +95,17 @@
#endif /* HAVE_VALUES_H */ #endif /* HAVE_VALUES_H */
/* the #pragma } statment is used to fix up emacs' c-mode which gets
* confused by extern "C" {. the ansi standard says that compilers
* have to ignore #pragma directives that they don't know about,
* so we should be save in using this.
*/
#ifdef __cplusplus
extern "C" {
#pragma }
#endif /* __cplusplus */
/* Provide definitions for some commonly used macros. /* Provide definitions for some commonly used macros.
* Some of them are only provided if they haven't already * Some of them are only provided if they haven't already
* been defined. It is assumed that if they are already * been defined. It is assumed that if they are already
@ -155,6 +166,57 @@
#endif /* G_CODE_GENERATION */ #endif /* G_CODE_GENERATION */
/* inlining hassle. for compilers that don't allow the `inline' keyword,
* mostly because of strict ANSI C compliance or dumbness, we try to fall
* back to either `__inline__' or `__inline'.
* we define G_CAN_INLINE, if the compiler seems to be actually
* *capable* to do function inlining, in which case inline function bodys
* do make sense. we also define G_INLINE_FUNC to properly export the
* function prototypes if no inlinig can be performed.
* we special case most of the stuff, so inline functions can have a normal
* implementation by defining G_INLINE_FUNC to extern and G_CAN_INLINE to 1.
*/
#ifndef G_INLINE_FUNC
# define G_CAN_INLINE 1
#endif
#ifdef G_HAVE_INLINE
# if defined (__GNUC__) && defined (__STRICT_ANSI__)
# undef inline
# define inline __inline__
# endif
#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 */
# ifndef G_INLINE_FUNC
# undef G_CAN_INLINE
# endif
# endif
# endif
#endif
#ifndef G_INLINE_FUNC
# ifdef __GNUC__
# ifdef __OPTIMIZE__
# define G_INLINE_FUNC extern inline
# else
# undef G_CAN_INLINE
# define G_INLINE_FUNC extern
# endif
# else /* !__GNUC__ */
# ifdef G_CAN_INLINE
# define G_INLINE_FUNC static inline
# else
# define G_INLINE_FUNC extern
# endif
# endif /* !__GNUC__ */
#endif /* !G_INLINE_FUNC */
/* Provide simple macro statement wrappers (adapted from Perl): /* Provide simple macro statement wrappers (adapted from Perl):
* G_STMT_START { statements; } G_STMT_END; * G_STMT_START { statements; } G_STMT_END;
* can be used as a single statement, as in * can be used as a single statement, as in
@ -180,31 +242,6 @@
#endif #endif
/* ANSI does not permit the keyword `inline'.
*/
#if defined (__STRICT_ANSI__)
# undef inline
# ifdef __GNUC__
# define inline __inline__
# else /* !__GNUC__ */
# define inline /* don't inline */
# endif /* !__GNUC__ */
#endif /* __STRICT_ANSI__ */
/* When using gcc we want to use `extern inline' to avoid random
* warnings with -Wall. */
#ifdef __GNUC__
/* We want to also have a non-inlined version of the function
* available. We implement this by redefining GLIB_INLINE in a glib
* implementation file. */
# ifndef GLIB_INLINE
# define GLIB_INLINE extern inline
# endif
#else
# undef GLIB_INLINE
# define GLIB_INLINE inline
#endif
/* Provide macros to feature the GCC function attribute. /* Provide macros to feature the GCC function attribute.
*/ */
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4) #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4)
@ -242,8 +279,8 @@
/* Hacker macro to place breakpoints for x86 machines. /* Hacker macro to place breakpoints for x86 machines.
* Actual use is strongly deprecated of course ;) * Actual use is strongly deprecated of course ;)
*/ */
#if defined (__i386__) #if defined (__i386__) && defined (__GNUC__)
#define G_BREAKPOINT() G_STMT_START{ __asm__ ("int $03"); }G_STMT_END #define G_BREAKPOINT() G_STMT_START{ __asm__ volatile ("int $03"); }G_STMT_END
#else /* !__i386__ */ #else /* !__i386__ */
#define G_BREAKPOINT() #define G_BREAKPOINT()
#endif /* __i386__ */ #endif /* __i386__ */
@ -423,17 +460,6 @@
#endif /* !G_DISABLE_CHECKS */ #endif /* !G_DISABLE_CHECKS */
#ifdef __cplusplus
/* the #pragma } statment is used to fix up emacs' c-mode which gets
* confused by extern "C" {. the ansi standard says that compilers
* have to ignore #pragma directives that they don't know about,
* so we should be save in using this.
*/
extern "C" {
#pragma }
#endif /* __cplusplus */
/* Provide type definitions for commonly used types. /* Provide type definitions for commonly used types.
* These are useful because a "gint8" can be adjusted * These are useful because a "gint8" can be adjusted
* to be 1 byte (8 bits) on all platforms. Similarly and * to be 1 byte (8 bits) on all platforms. Similarly and
@ -1212,19 +1238,12 @@ gchar* g_get_current_dir (void);
#endif #endif
/* Bit tests /* Bit tests
*/ */
G_INLINE_FUNC gint
/* Prototypes are required for inline functions to pacify gcc when
* some warnings are enabled. */
gint g_bit_nth_lsf (guint32 mask, gint nth_bit);
gint g_bit_nth_msf (guint32 mask, gint nth_bit);
guint g_bit_storage (guint number);
GLIB_INLINE gint
g_bit_nth_lsf (guint32 mask, g_bit_nth_lsf (guint32 mask,
gint nth_bit) gint nth_bit)
#ifdef G_CAN_INLINE
{ {
do do
{ {
@ -1235,9 +1254,13 @@ g_bit_nth_lsf (guint32 mask,
while (nth_bit < 32); while (nth_bit < 32);
return -1; return -1;
} }
GLIB_INLINE gint #else
;
#endif
G_INLINE_FUNC gint
g_bit_nth_msf (guint32 mask, g_bit_nth_msf (guint32 mask,
gint nth_bit) gint nth_bit)
#ifdef G_CAN_INLINE
{ {
if (nth_bit < 0) if (nth_bit < 0)
nth_bit = 33; nth_bit = 33;
@ -1250,8 +1273,12 @@ g_bit_nth_msf (guint32 mask,
while (nth_bit > 0); while (nth_bit > 0);
return -1; return -1;
} }
GLIB_INLINE guint #else
;
#endif
G_INLINE_FUNC guint
g_bit_storage (guint number) g_bit_storage (guint number)
#ifdef G_CAN_INLINE
{ {
register guint n_bits = 0; register guint n_bits = 0;
@ -1262,6 +1289,9 @@ g_bit_storage (guint number)
} while (number); } while (number);
return n_bits; return n_bits;
} }
#else
;
#endif
/* String Chunks /* String Chunks

@ -16,6 +16,7 @@
* Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA. * Boston, MA 02111-1307, USA.
*/ */
#include <stdlib.h>
#include <stdarg.h> #include <stdarg.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>

@ -630,7 +630,7 @@ g_scanner_cur_token (GScanner *scanner)
GValue GValue
g_scanner_cur_value (GScanner *scanner) g_scanner_cur_value (GScanner *scanner)
{ {
register GValue v; GValue v;
v.v_int = 0; v.v_int = 0;
g_return_val_if_fail (scanner != NULL, v); g_return_val_if_fail (scanner != NULL, v);
@ -1138,8 +1138,8 @@ g_scanner_get_token_ll (GScanner *scanner,
register gboolean in_string_dq; register gboolean in_string_dq;
static guchar ch; static guchar ch;
register GTokenType token; register GTokenType token;
register GValue value;
register GString *gstring; register GString *gstring;
GValue value;
config = scanner->config; config = scanner->config;
(*value_p).v_int = 0; (*value_p).v_int = 0;

@ -25,10 +25,10 @@
#include <sys/types.h> #include <sys/types.h>
#include <sys/param.h> #include <sys/param.h>
/* When using gcc, we want to have a non-inlined version of the /* implement Glib's inline functions
* `extern inline'd functions in glib.h. We do this here. */ */
#define GLIB_INLINE #define G_INLINE_FUNC extern
#define G_CAN_INLINE 1
#include "glib.h" #include "glib.h"
const guint glib_major_version = GLIB_MAJOR_VERSION; const guint glib_major_version = GLIB_MAJOR_VERSION;

@ -9,9 +9,6 @@
/* Define if you have the vprintf function. */ /* Define if you have the vprintf function. */
#undef HAVE_VPRINTF #undef HAVE_VPRINTF
/* Define as __inline if that's what the C compiler calls it. */
#undef inline
/* Define if you have the ANSI C header files. */ /* Define if you have the ANSI C header files. */
#undef STDC_HEADERS #undef STDC_HEADERS
@ -39,6 +36,9 @@
#undef G_VA_COPY #undef G_VA_COPY
#undef G_VA_COPY_AS_ARRAY #undef G_VA_COPY_AS_ARRAY
#undef G_HAVE___INLINE
#undef G_HAVE___INLINE__
#undef G_HAVE_INLINE
#undef GLIB_MAJOR_VERSION #undef GLIB_MAJOR_VERSION
#undef GLIB_MINOR_VERSION #undef GLIB_MINOR_VERSION

@ -16,6 +16,7 @@
* Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA. * Boston, MA 02111-1307, USA.
*/ */
#include <stdlib.h>
#include <stdarg.h> #include <stdarg.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>

@ -630,7 +630,7 @@ g_scanner_cur_token (GScanner *scanner)
GValue GValue
g_scanner_cur_value (GScanner *scanner) g_scanner_cur_value (GScanner *scanner)
{ {
register GValue v; GValue v;
v.v_int = 0; v.v_int = 0;
g_return_val_if_fail (scanner != NULL, v); g_return_val_if_fail (scanner != NULL, v);
@ -1138,8 +1138,8 @@ g_scanner_get_token_ll (GScanner *scanner,
register gboolean in_string_dq; register gboolean in_string_dq;
static guchar ch; static guchar ch;
register GTokenType token; register GTokenType token;
register GValue value;
register GString *gstring; register GString *gstring;
GValue value;
config = scanner->config; config = scanner->config;
(*value_p).v_int = 0; (*value_p).v_int = 0;

@ -25,10 +25,10 @@
#include <sys/types.h> #include <sys/types.h>
#include <sys/param.h> #include <sys/param.h>
/* When using gcc, we want to have a non-inlined version of the /* implement Glib's inline functions
* `extern inline'd functions in glib.h. We do this here. */ */
#define GLIB_INLINE #define G_INLINE_FUNC extern
#define G_CAN_INLINE 1
#include "glib.h" #include "glib.h"
const guint glib_major_version = GLIB_MAJOR_VERSION; const guint glib_major_version = GLIB_MAJOR_VERSION;

@ -549,6 +549,22 @@ else
link_static_flag='-Bstatic' link_static_flag='-Bstatic'
;; ;;
linux*aout)
can_build_shared=no
;;
linux*)
case "$CC" in
*lcc | *lcc\ *)
wl=-Wl
link_static_flag='-static'
pic_flag=
;;
*)
can_build_shared=no
esac
;;
*) *)
can_build_shared=no can_build_shared=no
;; ;;

@ -706,7 +706,7 @@ main (int argc,
gbarray = g_byte_array_new (); gbarray = g_byte_array_new ();
for (i = 0; i < 10000; i++) for (i = 0; i < 10000; i++)
g_byte_array_append (gbarray, "abcd", 4); g_byte_array_append (gbarray, (guint8*) "abcd", 4);
for (i = 0; i < 10000; i++) for (i = 0; i < 10000; i++)
{ {

@ -706,7 +706,7 @@ main (int argc,
gbarray = g_byte_array_new (); gbarray = g_byte_array_new ();
for (i = 0; i < 10000; i++) for (i = 0; i < 10000; i++)
g_byte_array_append (gbarray, "abcd", 4); g_byte_array_append (gbarray, (guint8*) "abcd", 4);
for (i = 0; i < 10000; i++) for (i = 0; i < 10000; i++)
{ {