check for all three inline keywords individually.
authorTim Janik <timj@gtk.org>
Mon, 7 Sep 1998 09:43:54 +0000 (09:43 +0000)
committerTim Janik <timj@src.gnome.org>
Mon, 7 Sep 1998 09:43:54 +0000 (09:43 +0000)
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.

25 files changed:
ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-12
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
acconfig.h
autogen.sh
configure.in
garray.c
glib.h
glib/garray.c
glib/glib.h
glib/gmessages.c
glib/gscanner.c
glib/gutils.c
glibconfig.h.in
gmessages.c
gscanner.c
gutils.c
ltconfig
testglib.c
tests/testglib.c

index 4a3d932..47b5bd3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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>
 
        * configure.in: added -std1 check for ANSI compliance (from gtk)
index 4a3d932..47b5bd3 100644 (file)
@@ -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>
 
        * configure.in: added -std1 check for ANSI compliance (from gtk)
index 4a3d932..47b5bd3 100644 (file)
@@ -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>
 
        * configure.in: added -std1 check for ANSI compliance (from gtk)
index 4a3d932..47b5bd3 100644 (file)
@@ -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>
 
        * configure.in: added -std1 check for ANSI compliance (from gtk)
index 4a3d932..47b5bd3 100644 (file)
@@ -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>
 
        * configure.in: added -std1 check for ANSI compliance (from gtk)
index 4a3d932..47b5bd3 100644 (file)
@@ -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>
 
        * configure.in: added -std1 check for ANSI compliance (from gtk)
index 4a3d932..47b5bd3 100644 (file)
@@ -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>
 
        * configure.in: added -std1 check for ANSI compliance (from gtk)
index 4a3d932..47b5bd3 100644 (file)
@@ -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>
 
        * configure.in: added -std1 check for ANSI compliance (from gtk)
index 9c4e45f..60cc36f 100644 (file)
@@ -64,6 +64,9 @@
 
 #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
@@ -74,6 +77,8 @@
 /* #undef PACKAGE */
 /* #undef VERSION */
 
+
+
 \f
 /* Leave that blank line there!!  Autoheader needs it.
    If you're adding to this file, keep in mind:
index d9da49b..06b9ab1 100755 (executable)
@@ -1,11 +1,15 @@
 #!/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
@@ -13,7 +17,7 @@ DIE=0
 
 (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
@@ -21,7 +25,7 @@ DIE=0
 
 (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
@@ -31,8 +35,8 @@ if test "$DIE" -eq 1; then
        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
 }
 
@@ -41,10 +45,17 @@ if test -z "$*"; then
         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."
index c45184b..4c64fca 100644 (file)
@@ -143,11 +143,61 @@ AC_CHECK_SIZEOF(int)
 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))
@@ -244,7 +294,8 @@ AC_MSG_RESULT($gtk_ok)
 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([
index 3dac053..4425f1d 100644 (file)
--- a/garray.c
+++ b/garray.c
@@ -178,7 +178,7 @@ static GMemChunk *ptr_array_mem_chunk = NULL;
 
 
 GPtrArray*
-g_ptr_array_new ()
+g_ptr_array_new (void)
 {
   GRealPtrArray *array;
 
diff --git a/glib.h b/glib.h
index 12f3fba..7285782 100644 (file)
--- a/glib.h
+++ b/glib.h
@@ -23,7 +23,7 @@
  */
 #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
@@ -1212,19 +1238,12 @@ gchar*  g_get_current_dir       (void);
 #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
     {
@@ -1235,9 +1254,13 @@ g_bit_nth_lsf (guint32 mask,
   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;
@@ -1250,8 +1273,12 @@ g_bit_nth_msf (guint32 mask,
   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;
 
@@ -1262,6 +1289,9 @@ g_bit_storage (guint number)
     } while (number);
   return n_bits;
 }
+#else
+;
+#endif
 
 
 /* String Chunks
index 3dac053..4425f1d 100644 (file)
@@ -178,7 +178,7 @@ static GMemChunk *ptr_array_mem_chunk = NULL;
 
 
 GPtrArray*
-g_ptr_array_new ()
+g_ptr_array_new (void)
 {
   GRealPtrArray *array;
 
index 12f3fba..7285782 100644 (file)
@@ -23,7 +23,7 @@
  */
 #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
@@ -1212,19 +1238,12 @@ gchar*  g_get_current_dir       (void);
 #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
     {
@@ -1235,9 +1254,13 @@ g_bit_nth_lsf (guint32 mask,
   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;
@@ -1250,8 +1273,12 @@ g_bit_nth_msf (guint32 mask,
   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;
 
@@ -1262,6 +1289,9 @@ g_bit_storage (guint number)
     } while (number);
   return n_bits;
 }
+#else
+;
+#endif
 
 
 /* String Chunks
index 12a2c59..83d3073 100644 (file)
@@ -16,6 +16,7 @@
  * 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>
index f25b11d..8577368 100644 (file)
@@ -630,7 +630,7 @@ g_scanner_cur_token (GScanner *scanner)
 GValue
 g_scanner_cur_value (GScanner *scanner)
 {
-  register GValue v;
+  GValue v;
   
   v.v_int = 0;
   g_return_val_if_fail (scanner != NULL, v);
@@ -1138,8 +1138,8 @@ g_scanner_get_token_ll    (GScanner       *scanner,
   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;
index 419487e..8a3b03d 100644 (file)
 #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;
index 09ab327..aef9bd0 100644 (file)
@@ -9,9 +9,6 @@
 /* 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
 
@@ -39,6 +36,9 @@
 
 #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
index 12a2c59..83d3073 100644 (file)
@@ -16,6 +16,7 @@
  * 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>
index f25b11d..8577368 100644 (file)
@@ -630,7 +630,7 @@ g_scanner_cur_token (GScanner *scanner)
 GValue
 g_scanner_cur_value (GScanner *scanner)
 {
-  register GValue v;
+  GValue v;
   
   v.v_int = 0;
   g_return_val_if_fail (scanner != NULL, v);
@@ -1138,8 +1138,8 @@ g_scanner_get_token_ll    (GScanner       *scanner,
   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;
index 419487e..8a3b03d 100644 (file)
--- a/gutils.c
+++ b/gutils.c
 #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;
index 4cd5626..8d9d4e3 100755 (executable)
--- a/ltconfig
+++ b/ltconfig
@@ -549,6 +549,22 @@ else
     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
     ;;
index 01b6366..d044022 100644 (file)
@@ -706,7 +706,7 @@ main (int   argc,
 
   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++)
     {
index 01b6366..d044022 100644 (file)
@@ -706,7 +706,7 @@ main (int   argc,
 
   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++)
     {