From f8b6715ab13c16a14ee37b582260f579d1cffbbb Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Mon, 10 Jul 2000 18:02:51 +0000 Subject: [PATCH] Include ../config.h for HAVE_UNISTD_H. Use it to guard inclusion of 2000-07-10 Tor Lillqvist * gobject-query.c: Include ../config.h for HAVE_UNISTD_H. Use it to guard inclusion of . * 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 | 14 ++++++++++++++ gobject/gobject-query.c | 5 +++++ gobject/gtype.c | 6 +++--- gobject/gtype.h | 14 +++++++------- gobject/makefile.mingw.in | 2 +- 5 files changed, 30 insertions(+), 11 deletions(-) diff --git a/gobject/ChangeLog b/gobject/ChangeLog index f933ee5..51702e5 100644 --- a/gobject/ChangeLog +++ b/gobject/ChangeLog @@ -1,3 +1,17 @@ +2000-07-10 Tor Lillqvist + + * gobject-query.c: Include ../config.h for HAVE_UNISTD_H. Use it + to guard inclusion of . + + * 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 * genums.c: Move string.h include into the .c file diff --git a/gobject/gobject-query.c b/gobject/gobject-query.c index 6ee1b49..b80709a 100644 --- a/gobject/gobject-query.c +++ b/gobject/gobject-query.c @@ -16,11 +16,16 @@ * Free Software Foundation, Inc., 59 Temple Place, Suite 330, * Boston, MA 02111-1307, USA. */ +#include "../config.h" + #include #include #include +#include +#ifdef HAVE_UNISTD_H #include +#endif #include #include diff --git a/gobject/gtype.c b/gobject/gtype.c index 80394d5..7a5168e 100644 --- a/gobject/gtype.c +++ b/gobject/gtype.c @@ -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; diff --git a/gobject/gtype.h b/gobject/gtype.h index 8c60374..ffe2d01 100644 --- a/gobject/gtype.h +++ b/gobject/gtype.h @@ -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 } diff --git a/gobject/makefile.mingw.in b/gobject/makefile.mingw.in index 89b0b84..47ab9cb 100644 --- a/gobject/makefile.mingw.in +++ b/gobject/makefile.mingw.in @@ -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 -- 2.7.4