+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>
* configure.in: added -std1 check for ANSI compliance (from gtk)
+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>
* configure.in: added -std1 check for ANSI compliance (from gtk)
+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>
* configure.in: added -std1 check for ANSI compliance (from gtk)
+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>
* configure.in: added -std1 check for ANSI compliance (from gtk)
+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>
* configure.in: added -std1 check for ANSI compliance (from gtk)
+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>
* configure.in: added -std1 check for ANSI compliance (from gtk)
+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>
* configure.in: added -std1 check for ANSI compliance (from gtk)
+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>
* configure.in: added -std1 check for ANSI compliance (from gtk)
#undef G_VA_COPY
#undef G_VA_COPY_AS_ARRAY
+#undef G_HAVE___INLINE
+#undef G_HAVE___INLINE__
+#undef G_HAVE_INLINE
#undef GLIB_MAJOR_VERSION
#undef GLIB_MINOR_VERSION
/* #undef PACKAGE */
/* #undef VERSION */
+
+
\f
/* Leave that blank line there!! Autoheader needs it.
If you're adding to this file, keep in mind:
#!/bin/sh
# Run this to generate all the initial makefiles, etc.
+PROJECT=GLib
+TEST_TYPE=-f
+FILE=glib.h
+
DIE=0
(autoconf --version) < /dev/null > /dev/null 2>&1 || {
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 "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
DIE=1
(libtool --version) < /dev/null > /dev/null 2>&1 || {
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 "(or a newer version if it is available)"
DIE=1
(automake --version) < /dev/null > /dev/null 2>&1 || {
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 "(or a newer version if it is available)"
DIE=1
exit 1
fi
-test -f glib.h || {
- echo "You must run this script in the top-level GLIB directory"
+test $TEST_TYPE $FILE || {
+ echo "You must run this script in the top-level $PROJECT directory"
exit 1
}
echo "to pass any to it, please specify them on the $0 command line."
fi
-aclocal
-automake
+case $CC in
+*lcc | *lcc\ *) am_opt=--include-deps;;
+esac
+
+aclocal $ACLOCAL_FLAGS
+automake $am_opt
autoconf
+# optionally feature autoheader
+(autoheader --version) < /dev/null > /dev/null 2>&1 && autoheader
+
./configure "$@"
echo
-echo "Now type 'make' to compile GLIB."
+echo "Now type 'make' to compile $PROJECT."
AC_CHECK_SIZEOF(void *)
AC_CHECK_SIZEOF(long long)
-# long doubles were not used, and a portability problem
-# AC_C_LONG_DOUBLE
+dnl long doubles were not used, and a portability problem
+dnl AC_C_LONG_DOUBLE
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(limits.h, AC_DEFINE(HAVE_LIMITS_H))
AC_CHECK_HEADERS(values.h, AC_DEFINE(HAVE_VALUES_H))
dnl **********************
dnl *** va_copy checks ***
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_CACHE_VAL(glib_cv_va_copy,[
AC_TRY_RUN([
GPtrArray*
-g_ptr_array_new ()
+g_ptr_array_new (void)
{
GRealPtrArray *array;
*/
#include <glibconfig.h>
-/* support standard arg inline functions for assertment macros
+/* include varargs functions for assertment macros
*/
#include <stdarg.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.
* Some of them are only provided if they haven't already
* been defined. It is assumed that if they are already
#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):
* G_STMT_START { statements; } G_STMT_END;
* can be used as a single statement, as in
#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.
*/
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4)
/* Hacker macro to place breakpoints for x86 machines.
* Actual use is strongly deprecated of course ;)
*/
-#if defined (__i386__)
-#define G_BREAKPOINT() G_STMT_START{ __asm__ ("int $03"); }G_STMT_END
+#if defined (__i386__) && defined (__GNUC__)
+#define G_BREAKPOINT() G_STMT_START{ __asm__ volatile ("int $03"); }G_STMT_END
#else /* !__i386__ */
#define G_BREAKPOINT()
#endif /* __i386__ */
#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.
* These are useful because a "gint8" can be adjusted
* to be 1 byte (8 bits) on all platforms. Similarly and
#endif
-
/* Bit tests
*/
-
-/* 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_INLINE_FUNC gint
g_bit_nth_lsf (guint32 mask,
gint nth_bit)
+#ifdef G_CAN_INLINE
{
do
{
while (nth_bit < 32);
return -1;
}
-GLIB_INLINE gint
+#else
+;
+#endif
+G_INLINE_FUNC gint
g_bit_nth_msf (guint32 mask,
gint nth_bit)
+#ifdef G_CAN_INLINE
{
if (nth_bit < 0)
nth_bit = 33;
while (nth_bit > 0);
return -1;
}
-GLIB_INLINE guint
+#else
+;
+#endif
+G_INLINE_FUNC guint
g_bit_storage (guint number)
+#ifdef G_CAN_INLINE
{
register guint n_bits = 0;
} while (number);
return n_bits;
}
+#else
+;
+#endif
/* String Chunks
GPtrArray*
-g_ptr_array_new ()
+g_ptr_array_new (void)
{
GRealPtrArray *array;
*/
#include <glibconfig.h>
-/* support standard arg inline functions for assertment macros
+/* include varargs functions for assertment macros
*/
#include <stdarg.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.
* Some of them are only provided if they haven't already
* been defined. It is assumed that if they are already
#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):
* G_STMT_START { statements; } G_STMT_END;
* can be used as a single statement, as in
#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.
*/
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4)
/* Hacker macro to place breakpoints for x86 machines.
* Actual use is strongly deprecated of course ;)
*/
-#if defined (__i386__)
-#define G_BREAKPOINT() G_STMT_START{ __asm__ ("int $03"); }G_STMT_END
+#if defined (__i386__) && defined (__GNUC__)
+#define G_BREAKPOINT() G_STMT_START{ __asm__ volatile ("int $03"); }G_STMT_END
#else /* !__i386__ */
#define G_BREAKPOINT()
#endif /* __i386__ */
#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.
* These are useful because a "gint8" can be adjusted
* to be 1 byte (8 bits) on all platforms. Similarly and
#endif
-
/* Bit tests
*/
-
-/* 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_INLINE_FUNC gint
g_bit_nth_lsf (guint32 mask,
gint nth_bit)
+#ifdef G_CAN_INLINE
{
do
{
while (nth_bit < 32);
return -1;
}
-GLIB_INLINE gint
+#else
+;
+#endif
+G_INLINE_FUNC gint
g_bit_nth_msf (guint32 mask,
gint nth_bit)
+#ifdef G_CAN_INLINE
{
if (nth_bit < 0)
nth_bit = 33;
while (nth_bit > 0);
return -1;
}
-GLIB_INLINE guint
+#else
+;
+#endif
+G_INLINE_FUNC guint
g_bit_storage (guint number)
+#ifdef G_CAN_INLINE
{
register guint n_bits = 0;
} while (number);
return n_bits;
}
+#else
+;
+#endif
/* String Chunks
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
+#include <stdlib.h>
#include <stdarg.h>
#include <stdio.h>
#include <string.h>
GValue
g_scanner_cur_value (GScanner *scanner)
{
- register GValue v;
+ GValue v;
v.v_int = 0;
g_return_val_if_fail (scanner != NULL, v);
register gboolean in_string_dq;
static guchar ch;
register GTokenType token;
- register GValue value;
register GString *gstring;
+ GValue value;
config = scanner->config;
(*value_p).v_int = 0;
#include <sys/types.h>
#include <sys/param.h>
-/* When using gcc, we want to have a non-inlined version of the
- * `extern inline'd functions in glib.h. We do this here. */
-#define GLIB_INLINE
-
+/* implement Glib's inline functions
+ */
+#define G_INLINE_FUNC extern
+#define G_CAN_INLINE 1
#include "glib.h"
const guint glib_major_version = GLIB_MAJOR_VERSION;
/* Define if you have the vprintf function. */
#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. */
#undef STDC_HEADERS
#undef G_VA_COPY
#undef G_VA_COPY_AS_ARRAY
+#undef G_HAVE___INLINE
+#undef G_HAVE___INLINE__
+#undef G_HAVE_INLINE
#undef GLIB_MAJOR_VERSION
#undef GLIB_MINOR_VERSION
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
+#include <stdlib.h>
#include <stdarg.h>
#include <stdio.h>
#include <string.h>
GValue
g_scanner_cur_value (GScanner *scanner)
{
- register GValue v;
+ GValue v;
v.v_int = 0;
g_return_val_if_fail (scanner != NULL, v);
register gboolean in_string_dq;
static guchar ch;
register GTokenType token;
- register GValue value;
register GString *gstring;
+ GValue value;
config = scanner->config;
(*value_p).v_int = 0;
#include <sys/types.h>
#include <sys/param.h>
-/* When using gcc, we want to have a non-inlined version of the
- * `extern inline'd functions in glib.h. We do this here. */
-#define GLIB_INLINE
-
+/* implement Glib's inline functions
+ */
+#define G_INLINE_FUNC extern
+#define G_CAN_INLINE 1
#include "glib.h"
const guint glib_major_version = GLIB_MAJOR_VERSION;
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
;;
gbarray = g_byte_array_new ();
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++)
{
gbarray = g_byte_array_new ();
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++)
{