+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
* 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>
/* --- 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 --- */
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));
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;
#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
}
# 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