Include ../config.h for HAVE_UNISTD_H. Use it to guard inclusion of
authorTor Lillqvist <tml@iki.fi>
Mon, 10 Jul 2000 18:02:51 +0000 (18:02 +0000)
committerTor Lillqvist <tml@src.gnome.org>
Mon, 10 Jul 2000 18:02:51 +0000 (18:02 +0000)
2000-07-10  Tor Lillqvist  <tml@iki.fi>

* gobject-query.c: Include ../config.h for HAVE_UNISTD_H. Use it
to guard inclusion of <unistd.h>.

* gtype.h: Fix copy-paste errors in the ifdefs on how to declare a
variable for export. Call the macro GOBJECT_VAR.

* gtype.c: Declare _g_type_fundamental_last for export here, too.
(type_node_any_new): Use only constant expressions for sizeof
operator (for instance MSVC requires this).

* makefile.mingw.in: Define GOBJECT_COMPILATION.

gobject/ChangeLog
gobject/gobject-query.c
gobject/gtype.c
gobject/gtype.h
gobject/makefile.mingw.in

index f933ee5..51702e5 100644 (file)
@@ -1,3 +1,17 @@
+2000-07-10  Tor Lillqvist  <tml@iki.fi>
+
+       * gobject-query.c: Include ../config.h for HAVE_UNISTD_H. Use it
+       to guard inclusion of <unistd.h>.
+
+       * gtype.h: Fix copy-paste errors in the ifdefs on how to declare a
+       variable for export. Call the macro GOBJECT_VAR.
+
+       * gtype.c: Declare _g_type_fundamental_last for export here, too.
+       (type_node_any_new): Use only constant expressions for sizeof
+       operator (for instance MSVC requires this).
+
+       * makefile.mingw.in: Define GOBJECT_COMPILATION.
+
 Sun Jul  9 21:21:46 2000  Owen Taylor  <otaylor@redhat.com>
 
        * genums.c: Move string.h include into the .c file
index 6ee1b49..b80709a 100644 (file)
  * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
  * Boston, MA 02111-1307, USA.
  */
+#include       "../config.h"
+
 #include        <glib-object.h>
 
 #include       <stdio.h>
 #include       <stdlib.h>
+#include       <string.h>
+#ifdef HAVE_UNISTD_H
 #include       <unistd.h>
+#endif
 #include       <sys/stat.h>
 #include       <fcntl.h>
 
index 80394d5..7a5168e 100644 (file)
@@ -163,7 +163,7 @@ static ClassCacheFunc *class_cache_funcs = NULL;
 
 /* --- externs --- */
 const char *g_log_domain_gobject = "GLib-Object";
-GType       _g_type_fundamental_last = 0;
+GOBJECT_VAR GType _g_type_fundamental_last = 0;
 
 
 /* --- type nodes --- */
@@ -206,7 +206,7 @@ type_node_any_new (TypeNode    *pnode,
   if (!pnode)
     node_size += sizeof (GTypeFundamentalInfo);         /* fundamental type info */
   node_size += SIZEOF_BASE_TYPE_NODE ();        /* TypeNode structure */
-  node_size += sizeof (GType[1 + n_supers + 1]); /* self + anchestors + 0 for ->supers[] */
+  node_size += (sizeof (GType) * (1 + n_supers + 1)); /* self + ancestors + 0 for ->supers[] */
   node = g_malloc0 (node_size);
   if (!pnode)                                   /* fundamental type */
     node = G_STRUCT_MEMBER_P (node, sizeof (GTypeFundamentalInfo));
@@ -231,7 +231,7 @@ type_node_any_new (TypeNode    *pnode,
   else
     {
       node->supers[0] = type;
-      memcpy (node->supers + 1, pnode->supers, sizeof (GType[1 + pnode->n_supers + 1]));
+      memcpy (node->supers + 1, pnode->supers, sizeof (GType) * (1 + pnode->n_supers + 1));
 
       node->is_classed = pnode->is_classed;
       node->is_instantiatable = pnode->is_instantiatable;
index 8c60374..ffe2d01 100644 (file)
@@ -334,16 +334,16 @@ void             g_type_class_unref_uncached    (gpointer            g_class);
 #define _G_TYPE_CCT(cp, gt)             (g_type_class_is_a ((GTypeClass*) cp, gt))
 
 #ifdef G_OS_WIN32
-#  ifdef GMODULE_COMPILATION
-#    define GTYPE_C_VAR __declspec(dllexport)
-#  else /* !GLIB_COMPILATION */
-#    define GTYPE_C_VAR extern __declspec(dllimport)
-#  endif /* !GLIB_COMPILATION */
+#  ifdef GOBJECT_COMPILATION
+#    define GOBJECT_VAR __declspec(dllexport)
+#  else /* !GOBJECT_COMPILATION */
+#    define GOBJECT_VAR extern __declspec(dllimport)
+#  endif /* !GOBJECT_COMPILATION */
 #else /* !G_OS_WIN32 */
-#  define GTYPE_C_VAR extern
+#  define GOBJECT_VAR extern
 #endif /* !G_OS_WIN32 */
 
-GTYPE_C_VAR GType    _g_type_fundamental_last;
+GOBJECT_VAR GType    _g_type_fundamental_last;
 
 #ifdef __cplusplus
 }
index 89b0b84..47ab9cb 100644 (file)
@@ -14,7 +14,7 @@ include $(TOP)/build/win32/make.mingw
 # Nothing much configurable below
 
 INCLUDES = -I .. -I .
-DEFINES = -DHAVE_CONFIG_H -DG_LOG_DOMAIN=g_log_domain_gobject
+DEFINES = -DHAVE_CONFIG_H -DGOBJECT_COMPILATION -DG_LOG_DOMAIN=g_log_domain_gobject
 
 BUILD_DLL = ../build-dll