gtkmain: Fix build on Windows

gtk_init() removed its support for supporting arguments, so we ought to do
likewise for Windows, which actually defines items that call gtk_init()
the old way (and also get rid of argument support in those functions,
since the direction is to not support them).

https://bugzilla.gnome.org/show_bug.cgi?id=773299
This commit is contained in:
Chun-wei Fan 2017-01-20 18:38:53 +08:00
parent f31aad3963
commit 3629def0d0
2 changed files with 8 additions and 12 deletions

View File

@ -875,21 +875,21 @@ check_sizeof_GtkBox (size_t sizeof_GtkBox)
* in the number of extra args.
*/
void
gtk_init_abi_check (int *argc, char ***argv, int num_checks, size_t sizeof_GtkWindow, size_t sizeof_GtkBox)
gtk_init_abi_check (int num_checks, size_t sizeof_GtkWindow, size_t sizeof_GtkBox)
{
check_sizeof_GtkWindow (sizeof_GtkWindow);
if (num_checks >= 2)
check_sizeof_GtkBox (sizeof_GtkBox);
gtk_init (argc, argv);
gtk_init ();
}
gboolean
gtk_init_check_abi_check (int *argc, char ***argv, int num_checks, size_t sizeof_GtkWindow, size_t sizeof_GtkBox)
gtk_init_check_abi_check (int num_checks, size_t sizeof_GtkWindow, size_t sizeof_GtkBox)
{
check_sizeof_GtkWindow (sizeof_GtkWindow);
if (num_checks >= 2)
check_sizeof_GtkBox (sizeof_GtkBox);
return gtk_init_check (argc, argv);
return gtk_init_check ();
}
#endif

View File

@ -84,20 +84,16 @@ gboolean gtk_init_check (void);
* when building GTK+-using code.
*/
GDK_AVAILABLE_IN_ALL
void gtk_init_abi_check (int *argc,
char ***argv,
int num_checks,
void gtk_init_abi_check (int num_checks,
size_t sizeof_GtkWindow,
size_t sizeof_GtkBox);
GDK_AVAILABLE_IN_ALL
gboolean gtk_init_check_abi_check (int *argc,
char ***argv,
int num_checks,
gboolean gtk_init_check_abi_check (int num_checks,
size_t sizeof_GtkWindow,
size_t sizeof_GtkBox);
#define gtk_init(argc, argv) gtk_init_abi_check (argc, argv, 2, sizeof (GtkWindow), sizeof (GtkBox))
#define gtk_init_check(argc, argv) gtk_init_check_abi_check (argc, argv, 2, sizeof (GtkWindow), sizeof (GtkBox))
#define gtk_init() gtk_init_abi_check (2, sizeof (GtkWindow), sizeof (GtkBox))
#define gtk_init_check() gtk_init_check_abi_check (2, sizeof (GtkWindow), sizeof (GtkBox))
#endif