include <stdlib.h> and <stddef.h> if STDC_HEADERS is defined.
authorTim Janik <timj@gtk.org>
Wed, 26 Jul 2000 03:18:27 +0000 (03:18 +0000)
committerTim Janik <timj@src.gnome.org>
Wed, 26 Jul 2000 03:18:27 +0000 (03:18 +0000)
Wed Jul 26 05:03:24 2000  Tim Janik  <timj@gtk.org>

        * acglib.m4 (GLIB_SIZEOF): include <stdlib.h> and <stddef.h> if
        STDC_HEADERS is defined.

        * glib.h:
        * glibconfig.h: define gsize and gssize in terms of GLIB_SIZEOF_SIZE_T

        * glib.h (g_return_if_reached): applied darin's fix for copy'n
        paste error in the macro implementation.

12 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
acglib.m4
configure.in
glib.h
glib/glib.h

index e96c74f..572c768 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+Wed Jul 26 05:03:24 2000  Tim Janik  <timj@gtk.org>
+
+       * acglib.m4 (GLIB_SIZEOF): include <stdlib.h> and <stddef.h> if
+       STDC_HEADERS is defined.
+
+       * glib.h:
+       * glibconfig.h: define gsize and gssize in terms of GLIB_SIZEOF_SIZE_T
+
+       * glib.h (g_return_if_reached): applied darin's fix for copy'n
+       paste error in the macro implementation.
+
 Wed Jul 26 00:46:03 2000  Tim Janik  <timj@gtk.org>
 
        * glib.h: applied patch from Darin Adler <darin@eazel.com> which
index e96c74f..572c768 100644 (file)
@@ -1,3 +1,14 @@
+Wed Jul 26 05:03:24 2000  Tim Janik  <timj@gtk.org>
+
+       * acglib.m4 (GLIB_SIZEOF): include <stdlib.h> and <stddef.h> if
+       STDC_HEADERS is defined.
+
+       * glib.h:
+       * glibconfig.h: define gsize and gssize in terms of GLIB_SIZEOF_SIZE_T
+
+       * glib.h (g_return_if_reached): applied darin's fix for copy'n
+       paste error in the macro implementation.
+
 Wed Jul 26 00:46:03 2000  Tim Janik  <timj@gtk.org>
 
        * glib.h: applied patch from Darin Adler <darin@eazel.com> which
index e96c74f..572c768 100644 (file)
@@ -1,3 +1,14 @@
+Wed Jul 26 05:03:24 2000  Tim Janik  <timj@gtk.org>
+
+       * acglib.m4 (GLIB_SIZEOF): include <stdlib.h> and <stddef.h> if
+       STDC_HEADERS is defined.
+
+       * glib.h:
+       * glibconfig.h: define gsize and gssize in terms of GLIB_SIZEOF_SIZE_T
+
+       * glib.h (g_return_if_reached): applied darin's fix for copy'n
+       paste error in the macro implementation.
+
 Wed Jul 26 00:46:03 2000  Tim Janik  <timj@gtk.org>
 
        * glib.h: applied patch from Darin Adler <darin@eazel.com> which
index e96c74f..572c768 100644 (file)
@@ -1,3 +1,14 @@
+Wed Jul 26 05:03:24 2000  Tim Janik  <timj@gtk.org>
+
+       * acglib.m4 (GLIB_SIZEOF): include <stdlib.h> and <stddef.h> if
+       STDC_HEADERS is defined.
+
+       * glib.h:
+       * glibconfig.h: define gsize and gssize in terms of GLIB_SIZEOF_SIZE_T
+
+       * glib.h (g_return_if_reached): applied darin's fix for copy'n
+       paste error in the macro implementation.
+
 Wed Jul 26 00:46:03 2000  Tim Janik  <timj@gtk.org>
 
        * glib.h: applied patch from Darin Adler <darin@eazel.com> which
index e96c74f..572c768 100644 (file)
@@ -1,3 +1,14 @@
+Wed Jul 26 05:03:24 2000  Tim Janik  <timj@gtk.org>
+
+       * acglib.m4 (GLIB_SIZEOF): include <stdlib.h> and <stddef.h> if
+       STDC_HEADERS is defined.
+
+       * glib.h:
+       * glibconfig.h: define gsize and gssize in terms of GLIB_SIZEOF_SIZE_T
+
+       * glib.h (g_return_if_reached): applied darin's fix for copy'n
+       paste error in the macro implementation.
+
 Wed Jul 26 00:46:03 2000  Tim Janik  <timj@gtk.org>
 
        * glib.h: applied patch from Darin Adler <darin@eazel.com> which
index e96c74f..572c768 100644 (file)
@@ -1,3 +1,14 @@
+Wed Jul 26 05:03:24 2000  Tim Janik  <timj@gtk.org>
+
+       * acglib.m4 (GLIB_SIZEOF): include <stdlib.h> and <stddef.h> if
+       STDC_HEADERS is defined.
+
+       * glib.h:
+       * glibconfig.h: define gsize and gssize in terms of GLIB_SIZEOF_SIZE_T
+
+       * glib.h (g_return_if_reached): applied darin's fix for copy'n
+       paste error in the macro implementation.
+
 Wed Jul 26 00:46:03 2000  Tim Janik  <timj@gtk.org>
 
        * glib.h: applied patch from Darin Adler <darin@eazel.com> which
index e96c74f..572c768 100644 (file)
@@ -1,3 +1,14 @@
+Wed Jul 26 05:03:24 2000  Tim Janik  <timj@gtk.org>
+
+       * acglib.m4 (GLIB_SIZEOF): include <stdlib.h> and <stddef.h> if
+       STDC_HEADERS is defined.
+
+       * glib.h:
+       * glibconfig.h: define gsize and gssize in terms of GLIB_SIZEOF_SIZE_T
+
+       * glib.h (g_return_if_reached): applied darin's fix for copy'n
+       paste error in the macro implementation.
+
 Wed Jul 26 00:46:03 2000  Tim Janik  <timj@gtk.org>
 
        * glib.h: applied patch from Darin Adler <darin@eazel.com> which
index e96c74f..572c768 100644 (file)
@@ -1,3 +1,14 @@
+Wed Jul 26 05:03:24 2000  Tim Janik  <timj@gtk.org>
+
+       * acglib.m4 (GLIB_SIZEOF): include <stdlib.h> and <stddef.h> if
+       STDC_HEADERS is defined.
+
+       * glib.h:
+       * glibconfig.h: define gsize and gssize in terms of GLIB_SIZEOF_SIZE_T
+
+       * glib.h (g_return_if_reached): applied darin's fix for copy'n
+       paste error in the macro implementation.
+
 Wed Jul 26 00:46:03 2000  Tim Janik  <timj@gtk.org>
 
        * glib.h: applied patch from Darin Adler <darin@eazel.com> which
index 314d9e4..eab43fe 100644 (file)
--- a/acglib.m4
+++ b/acglib.m4
@@ -36,6 +36,10 @@ changequote([, ])dnl
 AC_MSG_CHECKING(size of $2)
 AC_CACHE_VAL(AC_CV_NAME,
 [AC_TRY_RUN([#include <stdio.h>
+#if STDC_HEADERS
+#include <stdlib.h>
+#include <stddef.h>
+#endif
 $1
 main()
 {
index 0849834..978ea5f 100644 (file)
@@ -337,7 +337,6 @@ AC_SUBST(STRIP_END)
 size_includes=["
 #include <stdarg.h>
 #include <stdio.h>
-#include <stdlib.h>
 #include <ctype.h>
 #include <string.h>
 "]
@@ -1191,9 +1190,23 @@ ${glib_extension}typedef unsigned $gint64 guint64;
 #define G_GINT64_FORMAT $gint64_format
 #define G_GUINT64_FORMAT $guint64_format
 #define G_GINT64_CONSTANT(val) $gint64_constant
+
 _______EOF
        fi
 
+       case x$glib_size_t in
+        x2) echo "typedef gint16  gssize;" >> $outfile
+            echo "typedef guint16 gsize;"  >> $outfile
+            ;;
+        x4) echo "typedef gint32  gssize;" >> $outfile
+            echo "typedef guint32 gsize;"  >> $outfile
+            ;;
+        x8) echo "typedef gint64  gssize;" >> $outfile
+            echo "typedef guint64 gsize;"  >> $outfile
+            ;;
+       *)  echo "#error size of size_t is unknown" >> $outfile
+            ;;
+        esac
 
        if test -z "$glib_unknown_void_p"; then
          cat >>$outfile <<_______EOF
@@ -1410,6 +1423,7 @@ $ac_cv_sizeof_long_long)
   gint64_constant='(G_GNUC_EXTENSION (val##LL))'
   ;;
 esac
+glib_size_t=$glib_cv_sizeof_size_t
 
 gintbits=`expr $ac_cv_sizeof_int \* 8`
 glongbits=`expr $ac_cv_sizeof_long \* 8`
diff --git a/glib.h b/glib.h
index 1420ed6..7f31ba9 100644 (file)
--- a/glib.h
+++ b/glib.h
@@ -55,6 +55,7 @@
  *  gint16, guint16
  *  gint32, guint32
  *  gint64, guint64
+ *  gssize, gsize
  *
  * It defines the G_BYTE_ORDER symbol to one of G_*_ENDIAN (see later in
  * this file). 
@@ -462,7 +463,7 @@ extern "C" {
 #define g_return_if_reached()          G_STMT_START{                   \
      g_log (G_LOG_DOMAIN,                                              \
            G_LOG_LEVEL_CRITICAL,                                       \
-           "file %s: line %d (%s): assertion `%s' failed",             \
+           "file %s: line %d (%s): should not be reached",             \
            __FILE__,                                                   \
            __LINE__,                                                   \
            __PRETTY_FUNCTION__);                                       \
@@ -506,7 +507,7 @@ extern "C" {
 #define g_return_if_reached()          G_STMT_START{           \
      g_log (G_LOG_DOMAIN,                                      \
            G_LOG_LEVEL_CRITICAL,                               \
-           "file %s: line %d: assertion `%s' failed",          \
+           "file %s: line %d: should not be reached",          \
            __FILE__,                                           \
            __LINE__);                                          \
      return;                           }G_STMT_END
@@ -568,8 +569,6 @@ typedef void* gpointer;
 typedef const void *gconstpointer;
 
 
-typedef gint32 gssize;
-typedef guint32 gsize;
 typedef guint32 GQuark;
 typedef gint32 GTime;
 
index 1420ed6..7f31ba9 100644 (file)
@@ -55,6 +55,7 @@
  *  gint16, guint16
  *  gint32, guint32
  *  gint64, guint64
+ *  gssize, gsize
  *
  * It defines the G_BYTE_ORDER symbol to one of G_*_ENDIAN (see later in
  * this file). 
@@ -462,7 +463,7 @@ extern "C" {
 #define g_return_if_reached()          G_STMT_START{                   \
      g_log (G_LOG_DOMAIN,                                              \
            G_LOG_LEVEL_CRITICAL,                                       \
-           "file %s: line %d (%s): assertion `%s' failed",             \
+           "file %s: line %d (%s): should not be reached",             \
            __FILE__,                                                   \
            __LINE__,                                                   \
            __PRETTY_FUNCTION__);                                       \
@@ -506,7 +507,7 @@ extern "C" {
 #define g_return_if_reached()          G_STMT_START{           \
      g_log (G_LOG_DOMAIN,                                      \
            G_LOG_LEVEL_CRITICAL,                               \
-           "file %s: line %d: assertion `%s' failed",          \
+           "file %s: line %d: should not be reached",          \
            __FILE__,                                           \
            __LINE__);                                          \
      return;                           }G_STMT_END
@@ -568,8 +569,6 @@ typedef void* gpointer;
 typedef const void *gconstpointer;
 
 
-typedef gint32 gssize;
-typedef guint32 gsize;
 typedef guint32 GQuark;
 typedef gint32 GTime;