msvc 5.0 can't cast from uint64 to double. Disable respective
authorHans Breuer <hans@breuer.org>
Sun, 10 Feb 2002 16:39:24 +0000 (16:39 +0000)
committerHans Breuer <hans@src.gnome.org>
Sun, 10 Feb 2002 16:39:24 +0000 (16:39 +0000)
2002-02-10  Hans Breuer  <hans@breuer.org>

* gvaluetransform.c : msvc 5.0 can't cast from uint64 to
double. Disable respective transform_func than.

* makefile.msc.in : build test programs

gobject/ChangeLog
gobject/gvaluetransform.c
gobject/makefile.msc.in

index 8939a9e5e1c7f94c6268eef52ae41b0859c3ddab..05db3c71ff65b9e3898200a4a5f09949e7eba64d 100644 (file)
@@ -1,3 +1,10 @@
+2002-02-10  Hans Breuer  <hans@breuer.org>
+
+       * gvaluetransform.c : msvc 5.0 can't cast from uint64 to
+       double. Disable respective transform_func than.
+
+       * makefile.msc.in : build test programs
+
 Thu Jan 24 07:39:56 2002  Tim Janik  <timj@gtk.org>
 
        * gobject.c (g_signal_connect_object): return gulong instead
index eb8f43b2614ebdce33c8461bd821dbfbd5b73e5b..dcc9203183ae210673d239a9783dc04e18e79ee0 100644 (file)
@@ -105,8 +105,16 @@ DEFINE_CAST (uint64_uint,  v_uint64, guint,   v_uint);
 DEFINE_CAST (uint64_long,      v_uint64, glong,   v_long);
 DEFINE_CAST (uint64_ulong,     v_uint64, gulong,  v_ulong);
 DEFINE_CAST (uint64_int64,     v_uint64, gint64,  v_int64);
+#ifdef _MSC_VER
+/* work around error C2520: conversion from unsigned __int64 to double
+ * not implemented, use signed __int64
+ * If it is supported don't miss to g_value_register_transform_func() below
+ */
+#pragma message ("Check if cast from uint64 to double is supported with msvc 6.0")
+#else
 DEFINE_CAST (uint64_float,     v_uint64, gfloat,  v_float);
 DEFINE_CAST (uint64_double,    v_uint64, gdouble, v_double);
+#endif
 DEFINE_CAST (float_s8,         v_float,  gint8,   v_int);
 DEFINE_CAST (float_u8,         v_float,  guint8,  v_uint);
 DEFINE_CAST (float_int,                v_float,  gint,    v_int);
@@ -370,8 +378,11 @@ g_value_transforms_init (void)             /* sync with gtype.c */
   g_value_register_transform_func (G_TYPE_UINT64,      G_TYPE_UINT64,          value_transform_uint64_uint64);
   g_value_register_transform_func (G_TYPE_UINT64,      G_TYPE_ENUM,            value_transform_uint64_int);
   g_value_register_transform_func (G_TYPE_UINT64,      G_TYPE_FLAGS,           value_transform_uint64_uint);
+#ifndef _MSC_VER
+  /* required casts unsupported with msvc 5.0 */
   g_value_register_transform_func (G_TYPE_UINT64,      G_TYPE_FLOAT,           value_transform_uint64_float);
   g_value_register_transform_func (G_TYPE_UINT64,      G_TYPE_DOUBLE,          value_transform_uint64_double);
+#endif
   g_value_register_transform_func (G_TYPE_UINT64,      G_TYPE_STRING,          value_transform_uint64_string);
   g_value_register_transform_func (G_TYPE_ENUM,                G_TYPE_CHAR,            value_transform_int_s8);
   g_value_register_transform_func (G_TYPE_ENUM,                G_TYPE_UCHAR,           value_transform_int_u8);
index 71442a408a44ccb7a6626cf68cc319311621dc45..36849ccb2f6c18519773fb425d58661baad8b09b 100644 (file)
@@ -25,7 +25,9 @@ all :                         \
        gmarshal.strings \
        gobject-query.exe \
        libgobject-@GLIB_MAJOR_VERSION@.@GLIB_MINOR_VERSION@-@LT_CURRENT_MINUS_AGE@.dll \
-       gobject-@GLIB_MAJOR_VERSION@.@GLIB_MINOR_VERSION@s.lib
+       gobject-@GLIB_MAJOR_VERSION@.@GLIB_MINOR_VERSION@s.lib \
+       testgruntime.exe        \
+       testoverride.exe
 
 gobject_OBJECTS =              \
        gboxed.obj              \
@@ -72,3 +74,7 @@ gobject-query.exe : gobject-query.c libgobject-@GLIB_MAJOR_VERSION@.@GLIB_MINOR_
 
 gmarshal.strings : gmarshal.list
        perl marshal-genstrings.pl > gmarshal.strings
+
+.c.exe :
+       $(CC) $(CFLAGS) -c $<
+       $(CC) $(CFLAGS) -Fe$@ $< gobject-@GLIB_MAJOR_VERSION@.@GLIB_MINOR_VERSION@.lib ..\glib\glib-@GLIB_MAJOR_VERSION@.@GLIB_MINOR_VERSION@.lib ..\gmodule\gmodule-@GLIB_MAJOR_VERSION@.@GLIB_MINOR_VERSION@.lib ..\gthread\gthread-@GLIB_MAJOR_VERSION@.@GLIB_MINOR_VERSION@.lib $(LDFLAGS) user32.lib /subsystem:console