Include ../config.h for HAVE_UNISTD_H. Use it to guard inclusion of

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.
This commit is contained in:
Tor Lillqvist 2000-07-10 18:02:51 +00:00 committed by Tor Lillqvist
parent 04bc211e6c
commit f8b6715ab1
5 changed files with 30 additions and 11 deletions

View 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

View File

@ -16,11 +16,16 @@
* 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>

View 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;

View 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
}

View 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