applied glib-tml-981101-1 patch from Tor Lillqvist (ChangeLog entry
authorManish Singh <yosh@src.gnome.org>
Sun, 1 Nov 1998 04:19:54 +0000 (04:19 +0000)
committerManish Singh <yosh@src.gnome.org>
Sun, 1 Nov 1998 04:19:54 +0000 (04:19 +0000)
* applied glib-tml-981101-1 patch from Tor Lillqvist (ChangeLog
entry appended below)

* testglib.c
* gstrfuncs.c
* glib.h: use G_HAVE_GINT64, since HAVE_GINT64 is gone

* gmessages.c
* gscanner.c: #include <config.h> in here too, for HAVE_UNISTD_H

-Yosh

27 files changed:
.cvsignore
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
glib.def
glib.h
glib/glib.def
glib/glib.h
glib/gmessages.c
glib/gscanner.c
glib/gstrfuncs.c
glib/gtimer.c
glib/gutils.c
glibconfig.h.in [deleted file]
gmessages.c
gscanner.c
gstrfuncs.c
gtimer.c
gutils.c
makefile.msc
testglib.c
tests/testglib.c

index 772b89c..e5db9f7 100644 (file)
@@ -16,3 +16,6 @@ testglib
 config.cache
 glib-config
 libglib.la
+config.h.in
+config.h
+stamp-gc-h
index f3bad00..99483d0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,30 @@
+Sat Oct 31 20:14:22 PST 1998 Manish Singh <yosh@gimp.org>
+
+       * applied glib-tml-981101-1 patch from Tor Lillqvist (ChangeLog
+       entry appended below)
+
+       * testglib.c
+       * gstrfuncs.c
+       * glib.h: use G_HAVE_GINT64, since HAVE_GINT64 is gone
+
+       * gmessages.c
+       * gscanner.c: #include <config.h> in here too, for HAVE_UNISTD_H
+1998-11-01 Tor Lillqvist <tml@iki.fi>
+
+       * glib.def: Added the new functions.
+
+       * gutils.c:
+       (g_getenv): Better implementation on Win32. No loop necessary.
+       (g_get_any_init): Use P_tmpdir if defined as tmp directory. Don't
+       set home dir always to NULL on Win32.  Don't use tmp directory as
+       last resort home directory, but return NULL if no home
+       directory is known (application must check).
+
+       * makefile.msc: Better touch command, just COPYing a single file
+       sets the timestamp from that file, which isn't what touching should
+       do.
+
 1998-10-31  Raja R Harinath  <harinath@cs.umn.edu>
 
        Land glib-rrh-19981025-0.patch.
index f3bad00..99483d0 100644 (file)
@@ -1,3 +1,30 @@
+Sat Oct 31 20:14:22 PST 1998 Manish Singh <yosh@gimp.org>
+
+       * applied glib-tml-981101-1 patch from Tor Lillqvist (ChangeLog
+       entry appended below)
+
+       * testglib.c
+       * gstrfuncs.c
+       * glib.h: use G_HAVE_GINT64, since HAVE_GINT64 is gone
+
+       * gmessages.c
+       * gscanner.c: #include <config.h> in here too, for HAVE_UNISTD_H
+1998-11-01 Tor Lillqvist <tml@iki.fi>
+
+       * glib.def: Added the new functions.
+
+       * gutils.c:
+       (g_getenv): Better implementation on Win32. No loop necessary.
+       (g_get_any_init): Use P_tmpdir if defined as tmp directory. Don't
+       set home dir always to NULL on Win32.  Don't use tmp directory as
+       last resort home directory, but return NULL if no home
+       directory is known (application must check).
+
+       * makefile.msc: Better touch command, just COPYing a single file
+       sets the timestamp from that file, which isn't what touching should
+       do.
+
 1998-10-31  Raja R Harinath  <harinath@cs.umn.edu>
 
        Land glib-rrh-19981025-0.patch.
index f3bad00..99483d0 100644 (file)
@@ -1,3 +1,30 @@
+Sat Oct 31 20:14:22 PST 1998 Manish Singh <yosh@gimp.org>
+
+       * applied glib-tml-981101-1 patch from Tor Lillqvist (ChangeLog
+       entry appended below)
+
+       * testglib.c
+       * gstrfuncs.c
+       * glib.h: use G_HAVE_GINT64, since HAVE_GINT64 is gone
+
+       * gmessages.c
+       * gscanner.c: #include <config.h> in here too, for HAVE_UNISTD_H
+1998-11-01 Tor Lillqvist <tml@iki.fi>
+
+       * glib.def: Added the new functions.
+
+       * gutils.c:
+       (g_getenv): Better implementation on Win32. No loop necessary.
+       (g_get_any_init): Use P_tmpdir if defined as tmp directory. Don't
+       set home dir always to NULL on Win32.  Don't use tmp directory as
+       last resort home directory, but return NULL if no home
+       directory is known (application must check).
+
+       * makefile.msc: Better touch command, just COPYing a single file
+       sets the timestamp from that file, which isn't what touching should
+       do.
+
 1998-10-31  Raja R Harinath  <harinath@cs.umn.edu>
 
        Land glib-rrh-19981025-0.patch.
index f3bad00..99483d0 100644 (file)
@@ -1,3 +1,30 @@
+Sat Oct 31 20:14:22 PST 1998 Manish Singh <yosh@gimp.org>
+
+       * applied glib-tml-981101-1 patch from Tor Lillqvist (ChangeLog
+       entry appended below)
+
+       * testglib.c
+       * gstrfuncs.c
+       * glib.h: use G_HAVE_GINT64, since HAVE_GINT64 is gone
+
+       * gmessages.c
+       * gscanner.c: #include <config.h> in here too, for HAVE_UNISTD_H
+1998-11-01 Tor Lillqvist <tml@iki.fi>
+
+       * glib.def: Added the new functions.
+
+       * gutils.c:
+       (g_getenv): Better implementation on Win32. No loop necessary.
+       (g_get_any_init): Use P_tmpdir if defined as tmp directory. Don't
+       set home dir always to NULL on Win32.  Don't use tmp directory as
+       last resort home directory, but return NULL if no home
+       directory is known (application must check).
+
+       * makefile.msc: Better touch command, just COPYing a single file
+       sets the timestamp from that file, which isn't what touching should
+       do.
+
 1998-10-31  Raja R Harinath  <harinath@cs.umn.edu>
 
        Land glib-rrh-19981025-0.patch.
index f3bad00..99483d0 100644 (file)
@@ -1,3 +1,30 @@
+Sat Oct 31 20:14:22 PST 1998 Manish Singh <yosh@gimp.org>
+
+       * applied glib-tml-981101-1 patch from Tor Lillqvist (ChangeLog
+       entry appended below)
+
+       * testglib.c
+       * gstrfuncs.c
+       * glib.h: use G_HAVE_GINT64, since HAVE_GINT64 is gone
+
+       * gmessages.c
+       * gscanner.c: #include <config.h> in here too, for HAVE_UNISTD_H
+1998-11-01 Tor Lillqvist <tml@iki.fi>
+
+       * glib.def: Added the new functions.
+
+       * gutils.c:
+       (g_getenv): Better implementation on Win32. No loop necessary.
+       (g_get_any_init): Use P_tmpdir if defined as tmp directory. Don't
+       set home dir always to NULL on Win32.  Don't use tmp directory as
+       last resort home directory, but return NULL if no home
+       directory is known (application must check).
+
+       * makefile.msc: Better touch command, just COPYing a single file
+       sets the timestamp from that file, which isn't what touching should
+       do.
+
 1998-10-31  Raja R Harinath  <harinath@cs.umn.edu>
 
        Land glib-rrh-19981025-0.patch.
index f3bad00..99483d0 100644 (file)
@@ -1,3 +1,30 @@
+Sat Oct 31 20:14:22 PST 1998 Manish Singh <yosh@gimp.org>
+
+       * applied glib-tml-981101-1 patch from Tor Lillqvist (ChangeLog
+       entry appended below)
+
+       * testglib.c
+       * gstrfuncs.c
+       * glib.h: use G_HAVE_GINT64, since HAVE_GINT64 is gone
+
+       * gmessages.c
+       * gscanner.c: #include <config.h> in here too, for HAVE_UNISTD_H
+1998-11-01 Tor Lillqvist <tml@iki.fi>
+
+       * glib.def: Added the new functions.
+
+       * gutils.c:
+       (g_getenv): Better implementation on Win32. No loop necessary.
+       (g_get_any_init): Use P_tmpdir if defined as tmp directory. Don't
+       set home dir always to NULL on Win32.  Don't use tmp directory as
+       last resort home directory, but return NULL if no home
+       directory is known (application must check).
+
+       * makefile.msc: Better touch command, just COPYing a single file
+       sets the timestamp from that file, which isn't what touching should
+       do.
+
 1998-10-31  Raja R Harinath  <harinath@cs.umn.edu>
 
        Land glib-rrh-19981025-0.patch.
index f3bad00..99483d0 100644 (file)
@@ -1,3 +1,30 @@
+Sat Oct 31 20:14:22 PST 1998 Manish Singh <yosh@gimp.org>
+
+       * applied glib-tml-981101-1 patch from Tor Lillqvist (ChangeLog
+       entry appended below)
+
+       * testglib.c
+       * gstrfuncs.c
+       * glib.h: use G_HAVE_GINT64, since HAVE_GINT64 is gone
+
+       * gmessages.c
+       * gscanner.c: #include <config.h> in here too, for HAVE_UNISTD_H
+1998-11-01 Tor Lillqvist <tml@iki.fi>
+
+       * glib.def: Added the new functions.
+
+       * gutils.c:
+       (g_getenv): Better implementation on Win32. No loop necessary.
+       (g_get_any_init): Use P_tmpdir if defined as tmp directory. Don't
+       set home dir always to NULL on Win32.  Don't use tmp directory as
+       last resort home directory, but return NULL if no home
+       directory is known (application must check).
+
+       * makefile.msc: Better touch command, just COPYing a single file
+       sets the timestamp from that file, which isn't what touching should
+       do.
+
 1998-10-31  Raja R Harinath  <harinath@cs.umn.edu>
 
        Land glib-rrh-19981025-0.patch.
index f3bad00..99483d0 100644 (file)
@@ -1,3 +1,30 @@
+Sat Oct 31 20:14:22 PST 1998 Manish Singh <yosh@gimp.org>
+
+       * applied glib-tml-981101-1 patch from Tor Lillqvist (ChangeLog
+       entry appended below)
+
+       * testglib.c
+       * gstrfuncs.c
+       * glib.h: use G_HAVE_GINT64, since HAVE_GINT64 is gone
+
+       * gmessages.c
+       * gscanner.c: #include <config.h> in here too, for HAVE_UNISTD_H
+1998-11-01 Tor Lillqvist <tml@iki.fi>
+
+       * glib.def: Added the new functions.
+
+       * gutils.c:
+       (g_getenv): Better implementation on Win32. No loop necessary.
+       (g_get_any_init): Use P_tmpdir if defined as tmp directory. Don't
+       set home dir always to NULL on Win32.  Don't use tmp directory as
+       last resort home directory, but return NULL if no home
+       directory is known (application must check).
+
+       * makefile.msc: Better touch command, just COPYing a single file
+       sets the timestamp from that file, which isn't what touching should
+       do.
+
 1998-10-31  Raja R Harinath  <harinath@cs.umn.edu>
 
        Land glib-rrh-19981025-0.patch.
index 0adf2e9..ba9f12c 100644 (file)
--- a/glib.def
+++ b/glib.def
@@ -204,6 +204,7 @@ EXPORTS
        g_scanner_scope_remove_symbol
        g_scanner_set_scope
        g_scanner_stat_mode
+       g_scanner_sync_file_offset
        g_scanner_thaw_symbol_table
        g_scanner_unexp_token
        g_scanner_warn
@@ -245,6 +246,7 @@ EXPORTS
        g_strdup_printf
        g_strdup_vprintf
        g_strerror
+       g_strfreev
        g_string_append
        g_string_append_c
        g_string_assign
@@ -265,11 +267,13 @@ EXPORTS
        g_string_sprintfa
        g_string_truncate
        g_string_up
+       g_strjoinv
        g_strescape
        g_strndup
        g_strnfill
        g_strreverse
        g_strsignal
+       g_strsplit
        g_strtod
        g_strup
        g_timer_destroy
diff --git a/glib.h b/glib.h
index b7ee4f9..9041ef5 100644 (file)
--- a/glib.h
+++ b/glib.h
@@ -587,7 +587,7 @@ typedef gint32      GTime;
 #  define GUINT32_SWAP_LE_BE(val) (GUINT32_SWAP_LE_BE_CONSTANT (val))
 #endif /* __i386__ */
 
-#ifdef HAVE_GINT64
+#ifdef G_HAVE_GINT64
 #define GUINT64_SWAP_LE_BE(val)         ((guint64) ( \
     (((guint64) (val) & (guint64) 0x00000000000000ffU) << 56) | \
     (((guint64) (val) & (guint64) 0x000000000000ff00U) << 40) | \
@@ -625,7 +625,7 @@ typedef gint32      GTime;
 #  define GUINT32_FROM_LE(val)         ((guint32) (val))
 #  define GINT32_FROM_BE(val)          ((gint32) GUINT32_SWAP_LE_BE (val))
 #  define GUINT32_FROM_BE(val)         (GUINT32_SWAP_LE_BE (val))
-#  ifdef HAVE_GINT64
+#  ifdef G_HAVE_GINT64
 #  define GINT64_TO_LE(val)            ((gint64) (val))
 #  define GUINT64_TO_LE(val)           ((guint64) (val))
 #  define GINT64_TO_BE(val)            ((gint64) GUINT64_SWAP_LE_BE (val))
@@ -652,7 +652,7 @@ typedef gint32      GTime;
 #  define GUINT32_FROM_BE(val)         ((guint32) (val))
 #  define GINT32_FROM_LE(val)          ((gint32) GUINT32_SWAP_LE_BE (val))
 #  define GUINT32_FROM_LE(val)         (GUINT32_SWAP_LE_BE (val))
-#  ifdef HAVE_GINT64
+#  ifdef G_HAVE_GINT64
 #  define GINT64_TO_BE(val)            ((gint64) (val))
 #  define GUINT64_TO_BE(val)           ((guint64) (val))
 #  define GINT64_TO_LE(val)            ((gint64) GUINT64_SWAP_LE_BE (val))
index 0adf2e9..ba9f12c 100644 (file)
@@ -204,6 +204,7 @@ EXPORTS
        g_scanner_scope_remove_symbol
        g_scanner_set_scope
        g_scanner_stat_mode
+       g_scanner_sync_file_offset
        g_scanner_thaw_symbol_table
        g_scanner_unexp_token
        g_scanner_warn
@@ -245,6 +246,7 @@ EXPORTS
        g_strdup_printf
        g_strdup_vprintf
        g_strerror
+       g_strfreev
        g_string_append
        g_string_append_c
        g_string_assign
@@ -265,11 +267,13 @@ EXPORTS
        g_string_sprintfa
        g_string_truncate
        g_string_up
+       g_strjoinv
        g_strescape
        g_strndup
        g_strnfill
        g_strreverse
        g_strsignal
+       g_strsplit
        g_strtod
        g_strup
        g_timer_destroy
index b7ee4f9..9041ef5 100644 (file)
@@ -587,7 +587,7 @@ typedef gint32      GTime;
 #  define GUINT32_SWAP_LE_BE(val) (GUINT32_SWAP_LE_BE_CONSTANT (val))
 #endif /* __i386__ */
 
-#ifdef HAVE_GINT64
+#ifdef G_HAVE_GINT64
 #define GUINT64_SWAP_LE_BE(val)         ((guint64) ( \
     (((guint64) (val) & (guint64) 0x00000000000000ffU) << 56) | \
     (((guint64) (val) & (guint64) 0x000000000000ff00U) << 40) | \
@@ -625,7 +625,7 @@ typedef gint32      GTime;
 #  define GUINT32_FROM_LE(val)         ((guint32) (val))
 #  define GINT32_FROM_BE(val)          ((gint32) GUINT32_SWAP_LE_BE (val))
 #  define GUINT32_FROM_BE(val)         (GUINT32_SWAP_LE_BE (val))
-#  ifdef HAVE_GINT64
+#  ifdef G_HAVE_GINT64
 #  define GINT64_TO_LE(val)            ((gint64) (val))
 #  define GUINT64_TO_LE(val)           ((guint64) (val))
 #  define GINT64_TO_BE(val)            ((gint64) GUINT64_SWAP_LE_BE (val))
@@ -652,7 +652,7 @@ typedef gint32      GTime;
 #  define GUINT32_FROM_BE(val)         ((guint32) (val))
 #  define GINT32_FROM_LE(val)          ((gint32) GUINT32_SWAP_LE_BE (val))
 #  define GUINT32_FROM_LE(val)         (GUINT32_SWAP_LE_BE (val))
-#  ifdef HAVE_GINT64
+#  ifdef G_HAVE_GINT64
 #  define GINT64_TO_BE(val)            ((gint64) (val))
 #  define GUINT64_TO_BE(val)           ((guint64) (val))
 #  define GINT64_TO_LE(val)            ((gint64) GUINT64_SWAP_LE_BE (val))
index fa52311..e0c6eac 100644 (file)
  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  * Boston, MA 02111-1307, USA.
  */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <stdlib.h>
 #include <stdarg.h>
 #include <stdio.h>
index 2bb0f47..04b3ae5 100644 (file)
  */
 #define                __gscanner_c__
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include       <stdlib.h>
 #include       <stdarg.h>
 #include       <string.h>
index 01816b3..c01877b 100644 (file)
@@ -828,11 +828,11 @@ g_printf_string_upper_bound (const gchar* format,
                case 'u':
                case 'x':
                case 'X':
-#ifdef HAVE_GINT64
+#ifdef G_HAVE_GINT64
                  if (extra_long)
                    (void) va_arg (args, gint64);
                  else
-#endif /* HAVE_GINT64 */
+#endif /* G_HAVE_GINT64 */
                    {
                      if (long_int)
                        (void) va_arg (args, long);
index a9ceed2..6e58fa0 100644 (file)
  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  * Boston, MA 02111-1307, USA.
  */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include "glib.h"
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
index a484821..92b0b19 100644 (file)
@@ -333,8 +333,10 @@ g_getenv (const gchar *variable)
   return getenv (variable);
 #else
   gchar *v;
-  guint l, k;
-  gchar *p;
+  guint k;
+  static gchar *p = NULL;
+  static gint l;
+  gchar dummy[2];
 
   g_return_val_if_fail (variable != NULL, NULL);
   
@@ -347,23 +349,20 @@ g_getenv (const gchar *variable)
    * calling ExpandEnvironmentStrings.
    */
 
-  v = g_strdup (v);
-  l = 16;
-  do
+  /* First check how much space we need */
+  k = ExpandEnvironmentStrings (v, dummy, 2);
+  /* Then allocate that much, and actualy do the expansion */
+  if (p == NULL)
     {
-      p = g_new (gchar, l);
-      
-      k = ExpandEnvironmentStrings (v, p, l);
-      if (k > l)
-       {
-         g_free (p);
-         l *= 2;
-       }
+      p = g_malloc (k);
+      l = k;
     }
-  while (k > l);
-  
-  g_free (v);
-  
+  else if (k > l)
+    {
+      p = g_realloc (p, k);
+      l = k;
+    }
+  ExpandEnvironmentStrings (v, p, k);
   return p;
 #endif
 }
@@ -388,13 +387,23 @@ g_get_any_init (void)
       if (!g_tmp_dir)
        g_tmp_dir = g_strdup (g_getenv ("TEMP"));
       
+#ifdef P_tmpdir
+      if (!g_tmp_dir)
+       {
+         int k;
+         g_tmp_dir = g_strdup (P_tmpdir);
+         k = strlen (g_tmp_dir);
+         if (g_tmp_dir[k-1] == G_DIR_SEPARATOR)
+           g_tmp_dir[k-1] = '\0';
+       }
+#endif
       if (!g_tmp_dir)
        {
 #ifndef NATIVE_WIN32
-         g_tmp_dir = g_strdup (G_DIR_SEPARATOR_S "tmp");
-#else /* !NATIVE_WIN32 */
-         g_tmp_dir = g_strdup (".");
-#endif /* !NATIVE_WIN32 */
+         g_tmp_dir = g_strdup ("/tmp");
+#else /* NATIVE_WIN32 */
+         g_tmp_dir = g_strdup ("C:\\");
+#endif /* NATIVE_WIN32 */
        }
       
       g_home_dir = g_strdup (g_getenv ("HOME"));
@@ -426,7 +435,6 @@ g_get_any_init (void)
          }
        else
          g_real_name = g_strdup (g_user_name);
-       g_home_dir = NULL;
       }
 #  else /* !NATIVE_WIN32 */
       g_user_name = g_strdup ("somebody");
@@ -435,9 +443,6 @@ g_get_any_init (void)
 #  endif /* !NATIVE_WIN32 */
 #endif /* !HAVE_PWD_H */
     }
-
-  if (!g_home_dir)
-    g_home_dir = g_strdup (g_tmp_dir);
 }
 
 gchar*
@@ -458,6 +463,12 @@ g_get_real_name (void)
   return g_real_name;
 }
 
+/* Return the home directory of the user. If there is a HOME
+ * environment variable, its value is returned, otherwise use some
+ * system-dependent way of finding it out. If no home directory can be
+ * deduced, return NULL.
+ */
+
 gchar*
 g_get_home_dir (void)
 {
@@ -467,6 +478,13 @@ g_get_home_dir (void)
   return g_home_dir;
 }
 
+/* Return a directory to be used to store temporary files. This is the
+ * value of the TMPDIR, TMP or TEMP environment variables (they are
+ * checked in that order). If none of those exist, use P_tmpdir from
+ * stdio.h.  If that isn't defined, return "/tmp" on POSIXly systems,
+ * and C:\ on Windows.
+ */
+
 gchar*
 g_get_tmp_dir (void)
 {
@@ -522,7 +540,7 @@ g_int_hash (gconstpointer v)
 GIOChannel*
 g_iochannel_new (gint fd)
 {
-  GIOChannel *channel = g_new0 (GIOChannel, 1);
+  GIOChannel *channel = g_new (GIOChannel, 1);
 
   channel->fd = fd;
 
diff --git a/glibconfig.h.in b/glibconfig.h.in
deleted file mode 100644 (file)
index 1d37515..0000000
+++ /dev/null
@@ -1,128 +0,0 @@
-/* glibconfig.h.in.  Generated automatically from configure.in by autoheader.  */
-
-/* Define to empty if the keyword does not work.  */
-#undef const
-
-/* Define if you don't have vprintf but do have _doprnt.  */
-#undef HAVE_DOPRNT
-
-/* Define if you have <unistd.h>.  */
-#undef HAVE_UNISTD_H
-
-/* Define if you have the vprintf function.  */
-#undef HAVE_VPRINTF
-
-/* Define if you have the ANSI C header files.  */
-#undef STDC_HEADERS
-
-/* Define if your processor stores words with the most significant
-   byte first (like Motorola and SPARC, unlike Intel and VAX).  */
-#undef WORDS_BIGENDIAN
-
-#undef ENABLE_MEM_CHECK
-#undef ENABLE_MEM_PROFILE
-
-#undef G_COMPILED_WITH_DEBUGGING
-#undef HAVE_BROKEN_WCTYPE
-#undef HAVE_DOPRNT
-#undef HAVE_FLOAT_H
-#undef HAVE_LIMITS_H
-#undef HAVE_LONG_DOUBLE
-#undef HAVE_PWD_H
-#undef HAVE_SYS_PARAM_H
-#undef HAVE_SYS_SELECT_H
-#undef HAVE_SYS_TIME_H
-#undef HAVE_SYS_TIMES_H
-#undef HAVE_STRERROR
-#undef HAVE_STRSIGNAL
-#undef HAVE_UNISTD_H
-#undef HAVE_VSNPRINTF
-#undef HAVE_VALUES_H
-#undef HAVE_VPRINTF
-#undef HAVE_WCHAR_H
-#undef HAVE_WCTYPE_H
-
-#undef NO_FD_SET
-#undef NO_SYS_ERRLIST
-#undef NO_SYS_SIGLIST
-
-#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 GLIB_MICRO_VERSION
-#undef GLIB_INTERFACE_AGE
-#undef GLIB_BINARY_AGE
-
-/* The number of bytes in a char.  */
-#undef SIZEOF_CHAR
-
-/* The number of bytes in a int.  */
-#undef SIZEOF_INT
-
-/* The number of bytes in a long.  */
-#undef SIZEOF_LONG
-
-/* The number of bytes in a long long.  */
-#undef SIZEOF_LONG_LONG
-
-/* The number of bytes in a short.  */
-#undef SIZEOF_SHORT
-
-/* The number of bytes in a void *.  */
-#undef SIZEOF_VOID_P
-
-/* Define if you have the atexit function.  */
-#undef HAVE_ATEXIT
-
-/* Define if you have the lstat function.  */
-#undef HAVE_LSTAT
-
-/* Define if you have the memmove function.  */
-#undef HAVE_MEMMOVE
-
-/* Define if you have the on_exit function.  */
-#undef HAVE_ON_EXIT
-
-/* Define if you have the strcasecmp function.  */
-#undef HAVE_STRCASECMP
-
-/* Define if you have the strerror function.  */
-#undef HAVE_STRERROR
-
-/* Define if you have the strsignal function.  */
-#undef HAVE_STRSIGNAL
-
-/* Define if you have the vsnprintf function.  */
-#undef HAVE_VSNPRINTF
-
-/* Define if you have the <float.h> header file.  */
-#undef HAVE_FLOAT_H
-
-/* Define if you have the <limits.h> header file.  */
-#undef HAVE_LIMITS_H
-
-/* Define if you have the <pwd.h> header file.  */
-#undef HAVE_PWD_H
-
-/* Define if you have the <sys/param.h> header file.  */
-#undef HAVE_SYS_PARAM_H
-
-/* Define if you have the <sys/select.h> header file.  */
-#undef HAVE_SYS_SELECT_H
-
-/* Define if you have the <sys/time.h> header file.  */
-#undef HAVE_SYS_TIME_H
-
-/* Define if you have the <sys/times.h> header file.  */
-#undef HAVE_SYS_TIMES_H
-
-/* Define if you have the <unistd.h> header file.  */
-#undef HAVE_UNISTD_H
-
-/* Define if you have the <values.h> header file.  */
-#undef HAVE_VALUES_H
index fa52311..e0c6eac 100644 (file)
  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  * Boston, MA 02111-1307, USA.
  */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <stdlib.h>
 #include <stdarg.h>
 #include <stdio.h>
index 2bb0f47..04b3ae5 100644 (file)
  */
 #define                __gscanner_c__
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include       <stdlib.h>
 #include       <stdarg.h>
 #include       <string.h>
index 01816b3..c01877b 100644 (file)
@@ -828,11 +828,11 @@ g_printf_string_upper_bound (const gchar* format,
                case 'u':
                case 'x':
                case 'X':
-#ifdef HAVE_GINT64
+#ifdef G_HAVE_GINT64
                  if (extra_long)
                    (void) va_arg (args, gint64);
                  else
-#endif /* HAVE_GINT64 */
+#endif /* G_HAVE_GINT64 */
                    {
                      if (long_int)
                        (void) va_arg (args, long);
index a9ceed2..6e58fa0 100644 (file)
--- a/gtimer.c
+++ b/gtimer.c
  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  * Boston, MA 02111-1307, USA.
  */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include "glib.h"
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
index a484821..92b0b19 100644 (file)
--- a/gutils.c
+++ b/gutils.c
@@ -333,8 +333,10 @@ g_getenv (const gchar *variable)
   return getenv (variable);
 #else
   gchar *v;
-  guint l, k;
-  gchar *p;
+  guint k;
+  static gchar *p = NULL;
+  static gint l;
+  gchar dummy[2];
 
   g_return_val_if_fail (variable != NULL, NULL);
   
@@ -347,23 +349,20 @@ g_getenv (const gchar *variable)
    * calling ExpandEnvironmentStrings.
    */
 
-  v = g_strdup (v);
-  l = 16;
-  do
+  /* First check how much space we need */
+  k = ExpandEnvironmentStrings (v, dummy, 2);
+  /* Then allocate that much, and actualy do the expansion */
+  if (p == NULL)
     {
-      p = g_new (gchar, l);
-      
-      k = ExpandEnvironmentStrings (v, p, l);
-      if (k > l)
-       {
-         g_free (p);
-         l *= 2;
-       }
+      p = g_malloc (k);
+      l = k;
     }
-  while (k > l);
-  
-  g_free (v);
-  
+  else if (k > l)
+    {
+      p = g_realloc (p, k);
+      l = k;
+    }
+  ExpandEnvironmentStrings (v, p, k);
   return p;
 #endif
 }
@@ -388,13 +387,23 @@ g_get_any_init (void)
       if (!g_tmp_dir)
        g_tmp_dir = g_strdup (g_getenv ("TEMP"));
       
+#ifdef P_tmpdir
+      if (!g_tmp_dir)
+       {
+         int k;
+         g_tmp_dir = g_strdup (P_tmpdir);
+         k = strlen (g_tmp_dir);
+         if (g_tmp_dir[k-1] == G_DIR_SEPARATOR)
+           g_tmp_dir[k-1] = '\0';
+       }
+#endif
       if (!g_tmp_dir)
        {
 #ifndef NATIVE_WIN32
-         g_tmp_dir = g_strdup (G_DIR_SEPARATOR_S "tmp");
-#else /* !NATIVE_WIN32 */
-         g_tmp_dir = g_strdup (".");
-#endif /* !NATIVE_WIN32 */
+         g_tmp_dir = g_strdup ("/tmp");
+#else /* NATIVE_WIN32 */
+         g_tmp_dir = g_strdup ("C:\\");
+#endif /* NATIVE_WIN32 */
        }
       
       g_home_dir = g_strdup (g_getenv ("HOME"));
@@ -426,7 +435,6 @@ g_get_any_init (void)
          }
        else
          g_real_name = g_strdup (g_user_name);
-       g_home_dir = NULL;
       }
 #  else /* !NATIVE_WIN32 */
       g_user_name = g_strdup ("somebody");
@@ -435,9 +443,6 @@ g_get_any_init (void)
 #  endif /* !NATIVE_WIN32 */
 #endif /* !HAVE_PWD_H */
     }
-
-  if (!g_home_dir)
-    g_home_dir = g_strdup (g_tmp_dir);
 }
 
 gchar*
@@ -458,6 +463,12 @@ g_get_real_name (void)
   return g_real_name;
 }
 
+/* Return the home directory of the user. If there is a HOME
+ * environment variable, its value is returned, otherwise use some
+ * system-dependent way of finding it out. If no home directory can be
+ * deduced, return NULL.
+ */
+
 gchar*
 g_get_home_dir (void)
 {
@@ -467,6 +478,13 @@ g_get_home_dir (void)
   return g_home_dir;
 }
 
+/* Return a directory to be used to store temporary files. This is the
+ * value of the TMPDIR, TMP or TEMP environment variables (they are
+ * checked in that order). If none of those exist, use P_tmpdir from
+ * stdio.h.  If that isn't defined, return "/tmp" on POSIXly systems,
+ * and C:\ on Windows.
+ */
+
 gchar*
 g_get_tmp_dir (void)
 {
@@ -522,7 +540,7 @@ g_int_hash (gconstpointer v)
 GIOChannel*
 g_iochannel_new (gint fd)
 {
-  GIOChannel *channel = g_new0 (GIOChannel, 1);
+  GIOChannel *channel = g_new (GIOChannel, 1);
 
   channel->fd = fd;
 
index 4798fdd..5f578a3 100644 (file)
@@ -9,7 +9,7 @@ CC = cl -G5 -GF -Ox -W3 -D_DLL -nologo
 
 LDFLAGS = /link /nodefaultlib:libc msvcrt.lib # /debug:full /debugtype:cv 
 INSTALL = copy
-TOUCH = copy makefile.msc
+TOUCH = copy makefile.msc+nul
 
 GLIB_VER = 1.1
 
index ed32765..3a20d62 100644 (file)
@@ -323,7 +323,7 @@ main (int   argc,
   guint n_dirname_checks = sizeof (dirname_checks) / sizeof (dirname_checks[0]);
   guint16 gu16t1 = 0x44afU, gu16t2 = 0xaf44U;
   guint32 gu32t1 = 0x02a7f109U, gu32t2 = 0x09f1a702U;
-#ifdef HAVE_GINT64
+#ifdef G_HAVE_GINT64
   guint64 gu64t1 = 0x1d636b02300a7aa7U, gu64t2 = 0xa77a0a30026b631dU;
 #endif
 
@@ -345,10 +345,10 @@ main (int   argc,
   TEST (NULL, sizeof (gint16) == 2);
   g_print ("\nchecking size of gint32: %d", (int)sizeof (gint32));
   TEST (NULL, sizeof (gint32) == 4);
-#ifdef HAVE_GINT64
+#ifdef G_HAVE_GINT64
   g_print ("\nchecking size of gint64: %d", (int)sizeof (gint64));
   TEST (NULL, sizeof (gint64) == 8);
-#endif /* HAVE_GINT64 */
+#endif /* G_HAVE_GINT64 */
   g_print ("\n");
 
   g_print ("checking g_dirname()...");
@@ -824,7 +824,7 @@ main (int   argc,
 #endif
   g_assert (GUINT16_SWAP_LE_BE (gu16t1) == gu16t2);  
   g_assert (GUINT32_SWAP_LE_BE (gu32t1) == gu32t2);  
-#ifdef HAVE_GINT64
+#ifdef G_HAVE_GINT64
   g_assert (GUINT64_SWAP_LE_BE (gu64t1) == gu64t2);  
 #endif
   g_print ("ok\n");
index ed32765..3a20d62 100644 (file)
@@ -323,7 +323,7 @@ main (int   argc,
   guint n_dirname_checks = sizeof (dirname_checks) / sizeof (dirname_checks[0]);
   guint16 gu16t1 = 0x44afU, gu16t2 = 0xaf44U;
   guint32 gu32t1 = 0x02a7f109U, gu32t2 = 0x09f1a702U;
-#ifdef HAVE_GINT64
+#ifdef G_HAVE_GINT64
   guint64 gu64t1 = 0x1d636b02300a7aa7U, gu64t2 = 0xa77a0a30026b631dU;
 #endif
 
@@ -345,10 +345,10 @@ main (int   argc,
   TEST (NULL, sizeof (gint16) == 2);
   g_print ("\nchecking size of gint32: %d", (int)sizeof (gint32));
   TEST (NULL, sizeof (gint32) == 4);
-#ifdef HAVE_GINT64
+#ifdef G_HAVE_GINT64
   g_print ("\nchecking size of gint64: %d", (int)sizeof (gint64));
   TEST (NULL, sizeof (gint64) == 8);
-#endif /* HAVE_GINT64 */
+#endif /* G_HAVE_GINT64 */
   g_print ("\n");
 
   g_print ("checking g_dirname()...");
@@ -824,7 +824,7 @@ main (int   argc,
 #endif
   g_assert (GUINT16_SWAP_LE_BE (gu16t1) == gu16t2);  
   g_assert (GUINT32_SWAP_LE_BE (gu32t1) == gu32t2);  
-#ifdef HAVE_GINT64
+#ifdef G_HAVE_GINT64
   g_assert (GUINT64_SWAP_LE_BE (gu64t1) == gu64t2);  
 #endif
   g_print ("ok\n");