gdk/gdkimage.h No need any longer on Win32 for the shared memory

2000-08-20  Tor Lillqvist  <tml@iki.fi>

	* gdk/gdkimage.h
	* gdk/win32/gdkimage-win32.c: No need any longer on Win32 for the
	shared memory image+pixmap GdkImage type, or
	gdk_image_bitmap_new(). They were used in the gdk_imlib port, but
	I am dropping that.

	* gtk/gtkmain.h: On Win32, use a #define to map gtk_init() to
	actually call gtk_init_abi_check(), passing also
	sizeof(GtkWindow). Ditto for gtk_init_check().

	* gtk/gtk.def
	* gtk/gtkmain.c: (gtk_init_abi_check, gtk_init_check_abi_check):
	New functions, used to check that the GTK+-using code has been
	compiled using the correct compiler and switches. In particular,
	with gcc one has to use the -fnative-struct switch as GTK+ is
	compiled with that.
This commit is contained in:
Tor Lillqvist
2000-08-19 21:46:05 +00:00
committed by Tor Lillqvist
parent 41885abc7c
commit 617e17da3f
12 changed files with 196 additions and 23 deletions

View File

@ -194,6 +194,8 @@ static gchar *add_dll_suffix(gchar *module_name)
}
#endif
#undef gtk_init_check
gboolean
gtk_init_check (int *argc,
char ***argv)
@ -460,6 +462,9 @@ gtk_init_check (int *argc,
return TRUE;
}
#undef gtk_init
void
gtk_init (int *argc, char ***argv)
{
@ -470,6 +475,38 @@ gtk_init (int *argc, char ***argv)
}
}
#ifdef G_OS_WIN32
static void
check_sizeof_GtkWindow (size_t sizeof_GtkWindow)
{
if (sizeof_GtkWindow != sizeof (GtkWindow))
g_error ("Incompatible build!\n"
"The code using GTK+ thinks GtkWindow is of different\n"
"size than it actually is in this build of GTK+.\n"
"On Windows, this probably means that you have compiled\n"
"your code with gcc without the -fnative-struct switch.");
}
/* These two functions might get more checks added later, thus pass
* in the number of extra args.
*/
void
gtk_init_abi_check (int *argc, char ***argv, int num_checks, size_t sizeof_GtkWindow)
{
check_sizeof_GtkWindow (sizeof_GtkWindow);
gtk_init (argc, argv);
}
gboolean
gtk_init_check_abi_check (int *argc, char ***argv, int num_checks, size_t sizeof_GtkWindow)
{
check_sizeof_GtkWindow (sizeof_GtkWindow);
return gtk_init_check (argc, argv);
}
#endif
void
gtk_exit (gint errorcode)
{