diff -Nru gobject-introspection-1.45.4/config.h.win32 gobject-introspection-1.46.0/config.h.win32 --- gobject-introspection-1.45.4/config.h.win32 2015-08-21 12:36:18.000000000 +0000 +++ gobject-introspection-1.46.0/config.h.win32 2015-09-22 11:24:42.000000000 +0000 @@ -96,7 +96,7 @@ #define PACKAGE_NAME "gobject-introspection" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "gojbect-introspection 1.45.4" +#define PACKAGE_STRING "gojbect-introspection 1.46.0" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "gobject-introspection" @@ -105,7 +105,7 @@ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "1.45.4" +#define PACKAGE_VERSION "1.46.0" /* Define to the platform's shared library suffix */ #define SHLIB_SUFFIX ".dll" @@ -126,7 +126,7 @@ #define STDC_HEADERS 1 /* Version number of package */ -#define VERSION "1.45.4" +#define VERSION "1.46.0" /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a `char[]'. */ diff -Nru gobject-introspection-1.45.4/configure gobject-introspection-1.46.0/configure --- gobject-introspection-1.45.4/configure 2015-08-21 12:36:13.000000000 +0000 +++ gobject-introspection-1.46.0/configure 2015-09-22 11:24:37.000000000 +0000 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for gobject-introspection 1.45.4. +# Generated by GNU Autoconf 2.69 for gobject-introspection 1.46.0. # # Report bugs to . # @@ -591,8 +591,8 @@ # Identity of this package. PACKAGE_NAME='gobject-introspection' PACKAGE_TARNAME='gobject-introspection' -PACKAGE_VERSION='1.45.4' -PACKAGE_STRING='gobject-introspection 1.45.4' +PACKAGE_VERSION='1.46.0' +PACKAGE_STRING='gobject-introspection 1.46.0' PACKAGE_BUGREPORT='http://bugzilla.gnome.org/enter_bug.cgi?product=gobject-introspection' PACKAGE_URL='' @@ -1430,7 +1430,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures gobject-introspection 1.45.4 to adapt to many kinds of systems. +\`configure' configures gobject-introspection 1.46.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1501,7 +1501,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of gobject-introspection 1.45.4:";; + short | recursive ) echo "Configuration of gobject-introspection 1.46.0:";; esac cat <<\_ACEOF @@ -1655,7 +1655,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -gobject-introspection configure 1.45.4 +gobject-introspection configure 1.46.0 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2207,7 +2207,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by gobject-introspection $as_me 1.45.4, which was +It was created by gobject-introspection $as_me 1.46.0, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3075,7 +3075,7 @@ # Define the identity of the package. PACKAGE='gobject-introspection' - VERSION='1.45.4' + VERSION='1.46.0' cat >>confdefs.h <<_ACEOF @@ -3349,7 +3349,7 @@ # Used in docs/reference/version.xml -GI_VERSION=1.45.4 +GI_VERSION=1.46.0 # Check for Win32 @@ -15513,7 +15513,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by gobject-introspection $as_me 1.45.4, which was +This file was extended by gobject-introspection $as_me 1.46.0, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -15579,7 +15579,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -gobject-introspection config.status 1.45.4 +gobject-introspection config.status 1.46.0 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff -Nru gobject-introspection-1.45.4/configure.ac gobject-introspection-1.46.0/configure.ac --- gobject-introspection-1.45.4/configure.ac 2015-08-21 12:33:04.000000000 +0000 +++ gobject-introspection-1.46.0/configure.ac 2015-09-22 11:24:07.000000000 +0000 @@ -3,8 +3,8 @@ dnl the gi version number m4_define(gi_major_version, 1) -m4_define(gi_minor_version, 45) -m4_define(gi_micro_version, 4) +m4_define(gi_minor_version, 46) +m4_define(gi_micro_version, 0) m4_define(gi_version, gi_major_version.gi_minor_version.gi_micro_version) AC_PREREQ([2.63]) diff -Nru gobject-introspection-1.45.4/debian/changelog gobject-introspection-1.46.0/debian/changelog --- gobject-introspection-1.45.4/debian/changelog 2015-09-03 13:27:53.000000000 +0000 +++ gobject-introspection-1.46.0/debian/changelog 2015-09-23 07:12:25.000000000 +0000 @@ -1,3 +1,9 @@ +gobject-introspection (1.46.0-0ubuntu1~wily0) wily; urgency=high + + * New upstream release + + -- Rico Tzschichholz Wed, 23 Sep 2015 09:12:25 +0200 + gobject-introspection (1.45.4-0ubuntu1~wily1) wily; urgency=medium * New upstream release diff -Nru gobject-introspection-1.45.4/docs/reference/html/index.html gobject-introspection-1.46.0/docs/reference/html/index.html --- gobject-introspection-1.45.4/docs/reference/html/index.html 2015-08-21 13:23:31.000000000 +0000 +++ gobject-introspection-1.46.0/docs/reference/html/index.html 2015-09-22 11:27:24.000000000 +0000 @@ -15,7 +15,7 @@

- This document is for GObject Introspection version 1.45.4 + This document is for GObject Introspection version 1.46.0 . The latest version of this documentation can be found on-line at http://developer.gnome.org/gi/unstable/. diff -Nru gobject-introspection-1.45.4/docs/reference/version.xml gobject-introspection-1.46.0/docs/reference/version.xml --- gobject-introspection-1.45.4/docs/reference/version.xml 2015-08-21 12:36:18.000000000 +0000 +++ gobject-introspection-1.46.0/docs/reference/version.xml 2015-09-22 11:24:42.000000000 +0000 @@ -1 +1 @@ -1.45.4 +1.46.0 diff -Nru gobject-introspection-1.45.4/gir/gio-2.0.c gobject-introspection-1.46.0/gir/gio-2.0.c --- gobject-introspection-1.45.4/gir/gio-2.0.c 2015-08-21 12:37:04.000000000 +0000 +++ gobject-introspection-1.46.0/gir/gio-2.0.c 2015-09-09 10:20:37.000000000 +0000 @@ -7031,16 +7031,6 @@ * the names must begin with a lowercase character, must not end * with a '-', and must not contain consecutive dashes. * - * GSettings supports change notification. The primary mechanism to - * watch for changes is to connect to the "changed" signal. You can - * optionally watch for changes on only a single key by using a signal - * detail. Signals are only guaranteed to be emitted for a given key - * after you have read the value of that key while a signal handler was - * connected for that key. Signals may or may not be emitted in the - * case that the key "changed" to the value that you had previously - * read. Signals may be reported in additional cases as well and the - * "changed" signal should really be treated as "may have changed". - * * Similar to GConf, the default values in GSettings schemas can be * localized, but the localized values are stored in gettext catalogs * and looked up with the domain that is specified in the @@ -15467,6 +15457,13 @@ * message. Similary, if a filter consumes an outgoing message, the * message will not be sent to the other peer. * + * If @user_data_free_func is non-%NULL, it will be called (in the + * thread-default main context of the thread you are calling this + * method from) at some point after @user_data is no longer + * needed. (It is not guaranteed to be called synchronously when the + * filter is removed, and may be called after @connection has been + * destroyed.) + * * Returns: a filter identifier that can be used with * g_dbus_connection_remove_filter() * Since: 2.26 @@ -16300,6 +16297,13 @@ * * Removes a filter. * + * Note that since filters run in a different thread, there is a race + * condition where it is possible that the filter will be running even + * after calling g_dbus_connection_remove_filter(), so you cannot just + * free data that the filter might be using. Instead, you should pass + * a #GDestroyNotify to g_dbus_connection_add_filter(), which will be + * called when it is guaranteed that the data is no longer needed. + * * Since: 2.26 */ @@ -16516,6 +16520,13 @@ * interpreted as part of a namespace or path. The first argument * of a signal is matched against that part as specified by D-Bus. * + * If @user_data_free_func is non-%NULL, it will be called (in the + * thread-default main context of the thread you are calling this + * method from) at some point after @user_data is no longer + * needed. (It is not guaranteed to be called synchronously when the + * signal is unsubscribed from, and may be called after @connection + * has been destroyed.) + * * Returns: a subscription identifier that can be used with g_dbus_connection_signal_unsubscribe() * Since: 2.26 */ @@ -21479,7 +21490,8 @@ * g_file_get_path: * @file: input #GFile * - * Gets the local pathname for #GFile, if one exists. + * Gets the local pathname for #GFile, if one exists. If non-%NULL, this is + * guaranteed to be an absolute, canonical path. It might contain symlinks. * * This call does no blocking I/O. * @@ -21547,10 +21559,10 @@ * * If @parent is %NULL then this function returns %TRUE if @file has any * parent at all. If @parent is non-%NULL then %TRUE is only returned - * if @file is a child of @parent. + * if @file is an immediate child of @parent. * - * Returns: %TRUE if @file is a child of @parent (or any parent in the - * case that @parent is %NULL). + * Returns: %TRUE if @file is an immediate child of @parent (or any parent in + * the case that @parent is %NULL). * Since: 2.24 */ @@ -26404,6 +26416,18 @@ */ +/** + * g_list_store_sort: + * @store: a #GListStore + * @compare_func: (scope call): pairwise comparison function for sorting + * @user_data: (closure): user data for @compare_func + * + * Sort the items in @store according to @compare_func. + * + * Since: 2.46 + */ + + /** * g_list_store_splice: * @store: a #GListStore diff -Nru gobject-introspection-1.45.4/gir/glib-2.0.c gobject-introspection-1.46.0/gir/glib-2.0.c --- gobject-introspection-1.45.4/gir/glib-2.0.c 2015-08-21 12:37:02.000000000 +0000 +++ gobject-introspection-1.46.0/gir/glib-2.0.c 2015-09-22 11:22:55.000000000 +0000 @@ -6971,7 +6971,7 @@ * The first, and preferred, option is to store the source ID returned by * functions such as g_timeout_add() or g_source_attach(), and explicitly * remove that source from the main context using g_source_remove() when the - * owning object is finalised. This ensures that the callback can only be + * owning object is finalized. This ensures that the callback can only be * invoked while the object is still alive. * * The second option is to hold a strong reference to the object in the @@ -7677,11 +7677,11 @@ * "assertions", which consists of running the test_assertions function. * * In addition to the traditional g_assert(), the test framework provides - * an extended set of assertions for string and numerical comparisons: - * g_assert_cmpfloat(), g_assert_cmpint(), g_assert_cmpuint(), - * g_assert_cmphex(), g_assert_cmpstr(). The advantage of these variants - * over plain g_assert() is that the assertion messages can be more - * elaborate, and include the values of the compared entities. + * an extended set of assertions for comparisons: g_assert_cmpfloat(), + * g_assert_cmpint(), g_assert_cmpuint(), g_assert_cmphex(), + * g_assert_cmpstr(), and g_assert_cmpmem(). The advantage of these + * variants over plain g_assert() is that the assertion messages can be + * more elaborate, and include the values of the compared entities. * * GLib ships with two utilities called [gtester][gtester] and * [gtester-report][gtester-report] to facilitate running tests and producing @@ -9042,6 +9042,30 @@ /** + * g_assert_cmpmem: + * @m1: pointer to a buffer + * @l1: length of @m1 + * @m2: pointer to another buffer + * @l2: length of @m2 + * + * Debugging macro to compare memory regions. If the comparison fails, + * an error message is logged and the application is either terminated + * or the testcase marked as failed. + * + * The effect of `g_assert_cmpmem (m1, l1, m2, l2)` is + * the same as `g_assert_true (l1 == l2 && memcmp (m1, m2, l1) == 0)`. + * The advantage of this macro is that it can produce a message that + * includes the actual values of @l1 and @l2. + * + * |[ + * g_assert_cmpmem (buf->data, buf->len, expected, sizeof (expected)); + * ]| + * + * Since: 2.46 + */ + + +/** * g_assert_cmpstr: * @s1: a string (may be %NULL) * @cmp: The comparison operator to use. @@ -10273,7 +10297,8 @@ * from 0 (least significant) to sizeof(#gulong) * 8 - 1 (31 or 63, * usually). To start searching from the 0th bit, set @nth_bit to -1. * - * Returns: the index of the first bit set which is higher than @nth_bit + * Returns: the index of the first bit set which is higher than @nth_bit, or -1 + * if no higher bits are set */ @@ -10288,7 +10313,8 @@ * usually). To start searching from the last bit, set @nth_bit to * -1 or GLIB_SIZEOF_LONG * 8. * - * Returns: the index of the first bit set which is lower than @nth_bit + * Returns: the index of the first bit set which is lower than @nth_bit, or -1 + * if no lower bits are set */ @@ -27727,13 +27753,17 @@ * @errnum: the system error number. See the standard C %errno * documentation * - * Returns a string corresponding to the given error code, e.g. - * "no such process". You should use this function in preference to - * strerror(), because it returns a string in UTF-8 encoding, and since - * not all platforms support the strerror() function. + * Returns a string corresponding to the given error code, e.g. "no + * such process". Unlike strerror(), this always returns a string in + * UTF-8 encoding, and the pointer is guaranteed to remain valid for + * the lifetime of the process. + * + * Note that the string may be translated according to the current locale. + * + * The value of %errno will not be changed by this function. * * Returns: a UTF-8 string describing the error code. If the error code - * is unknown, it returns "unknown error ()". + * is unknown, it returns a string like "unknown error ()". */ @@ -28048,7 +28078,7 @@ /** * g_string_free: - * @string: a #GString + * @string: (transfer full): a #GString * @free_segment: if %TRUE, the actual character data is freed as well * * Frees the memory allocated for the #GString. diff -Nru gobject-introspection-1.45.4/gir/gobject-2.0.c gobject-introspection-1.46.0/gir/gobject-2.0.c --- gobject-introspection-1.45.4/gir/gobject-2.0.c 2015-08-21 12:37:03.000000000 +0000 +++ gobject-introspection-1.46.0/gir/gobject-2.0.c 2015-09-22 11:22:55.000000000 +0000 @@ -901,17 +901,22 @@ /** * g_cclosure_marshal_BOOLEAN__FLAGS: - * @closure: the #GClosure to which the marshaller belongs - * @return_value: a #GValue which can store the returned #gboolean - * @n_param_values: 2 - * @param_values: a #GValue array holding instance and arg1 - * @invocation_hint: the invocation hint given as the last argument - * to g_closure_invoke() - * @marshal_data: additional data specified when registering the marshaller + * @closure: A #GClosure. + * @return_value: A #GValue to store the return value. May be %NULL + * if the callback of closure doesn't return a value. + * @n_param_values: The length of the @param_values array. + * @param_values: An array of #GValues holding the arguments + * on which to invoke the callback of closure. + * @invocation_hint: The invocation hint given as the last argument to + * g_closure_invoke(). + * @marshal_data: Additional data specified when registering the + * marshaller, see g_closure_set_marshal() and + * g_closure_set_meta_marshal() * - * A marshaller for a #GCClosure with a callback of type - * `gboolean (*callback) (gpointer instance, gint arg1, gpointer user_data)` where the #gint parameter - * denotes a flags type. + * A #GClosureMarshal function for use with signals with handlers that + * take a flags type as an argument and return a boolean. If you have + * such a signal, you will probably also need to use an accumulator, + * such as g_signal_accumulator_true_handled(). */ @@ -971,23 +976,39 @@ /** * g_cclosure_marshal_BOOL__FLAGS: + * @closure: A #GClosure. + * @return_value: A #GValue to store the return value. May be %NULL + * if the callback of closure doesn't return a value. + * @n_param_values: The length of the @param_values array. + * @param_values: An array of #GValues holding the arguments + * on which to invoke the callback of closure. + * @invocation_hint: The invocation hint given as the last argument to + * g_closure_invoke(). + * @marshal_data: Additional data specified when registering the + * marshaller, see g_closure_set_marshal() and + * g_closure_set_meta_marshal() * - * Another name for g_cclosure_marshal_BOOLEAN__FLAGS(). + * An old alias for g_cclosure_marshal_BOOLEAN__FLAGS(). */ /** * g_cclosure_marshal_STRING__OBJECT_POINTER: - * @closure: the #GClosure to which the marshaller belongs - * @return_value: a #GValue, which can store the returned string - * @n_param_values: 3 - * @param_values: a #GValue array holding instance, arg1 and arg2 - * @invocation_hint: the invocation hint given as the last argument - * to g_closure_invoke() - * @marshal_data: additional data specified when registering the marshaller + * @closure: A #GClosure. + * @return_value: A #GValue to store the return value. May be %NULL + * if the callback of closure doesn't return a value. + * @n_param_values: The length of the @param_values array. + * @param_values: An array of #GValues holding the arguments + * on which to invoke the callback of closure. + * @invocation_hint: The invocation hint given as the last argument to + * g_closure_invoke(). + * @marshal_data: Additional data specified when registering the + * marshaller, see g_closure_set_marshal() and + * g_closure_set_meta_marshal() * - * A marshaller for a #GCClosure with a callback of type - * `gchar* (*callback) (gpointer instance, GObject *arg1, gpointer arg2, gpointer user_data)`. + * A #GClosureMarshal function for use with signals with handlers that + * take a #GObject and a pointer and produce a string. It is highly + * unlikely that your signal handler fits this description. */ @@ -1012,16 +1033,20 @@ /** * g_cclosure_marshal_VOID__BOOLEAN: - * @closure: the #GClosure to which the marshaller belongs - * @return_value: ignored - * @n_param_values: 2 - * @param_values: a #GValue array holding the instance and the #gboolean parameter - * @invocation_hint: the invocation hint given as the last argument - * to g_closure_invoke() - * @marshal_data: additional data specified when registering the marshaller + * @closure: A #GClosure. + * @return_value: A #GValue to store the return value. May be %NULL + * if the callback of closure doesn't return a value. + * @n_param_values: The length of the @param_values array. + * @param_values: An array of #GValues holding the arguments + * on which to invoke the callback of closure. + * @invocation_hint: The invocation hint given as the last argument to + * g_closure_invoke(). + * @marshal_data: Additional data specified when registering the + * marshaller, see g_closure_set_marshal() and + * g_closure_set_meta_marshal() * - * A marshaller for a #GCClosure with a callback of type - * `void (*callback) (gpointer instance, gboolean arg1, gpointer user_data)`. + * A #GClosureMarshal function for use with signals with a single + * boolean argument. */ @@ -1046,16 +1071,20 @@ /** * g_cclosure_marshal_VOID__BOXED: - * @closure: the #GClosure to which the marshaller belongs - * @return_value: ignored - * @n_param_values: 2 - * @param_values: a #GValue array holding the instance and the #GBoxed* parameter - * @invocation_hint: the invocation hint given as the last argument - * to g_closure_invoke() - * @marshal_data: additional data specified when registering the marshaller + * @closure: A #GClosure. + * @return_value: A #GValue to store the return value. May be %NULL + * if the callback of closure doesn't return a value. + * @n_param_values: The length of the @param_values array. + * @param_values: An array of #GValues holding the arguments + * on which to invoke the callback of closure. + * @invocation_hint: The invocation hint given as the last argument to + * g_closure_invoke(). + * @marshal_data: Additional data specified when registering the + * marshaller, see g_closure_set_marshal() and + * g_closure_set_meta_marshal() * - * A marshaller for a #GCClosure with a callback of type - * `void (*callback) (gpointer instance, GBoxed *arg1, gpointer user_data)`. + * A #GClosureMarshal function for use with signals with a single + * argument which is any boxed pointer type. */ @@ -1080,16 +1109,20 @@ /** * g_cclosure_marshal_VOID__CHAR: - * @closure: the #GClosure to which the marshaller belongs - * @return_value: ignored - * @n_param_values: 2 - * @param_values: a #GValue array holding the instance and the #gchar parameter - * @invocation_hint: the invocation hint given as the last argument - * to g_closure_invoke() - * @marshal_data: additional data specified when registering the marshaller + * @closure: A #GClosure. + * @return_value: A #GValue to store the return value. May be %NULL + * if the callback of closure doesn't return a value. + * @n_param_values: The length of the @param_values array. + * @param_values: An array of #GValues holding the arguments + * on which to invoke the callback of closure. + * @invocation_hint: The invocation hint given as the last argument to + * g_closure_invoke(). + * @marshal_data: Additional data specified when registering the + * marshaller, see g_closure_set_marshal() and + * g_closure_set_meta_marshal() * - * A marshaller for a #GCClosure with a callback of type - * `void (*callback) (gpointer instance, gchar arg1, gpointer user_data)`. + * A #GClosureMarshal function for use with signals with a single + * character argument. */ @@ -1114,16 +1147,20 @@ /** * g_cclosure_marshal_VOID__DOUBLE: - * @closure: the #GClosure to which the marshaller belongs - * @return_value: ignored - * @n_param_values: 2 - * @param_values: a #GValue array holding the instance and the #gdouble parameter - * @invocation_hint: the invocation hint given as the last argument - * to g_closure_invoke() - * @marshal_data: additional data specified when registering the marshaller + * @closure: A #GClosure. + * @return_value: A #GValue to store the return value. May be %NULL + * if the callback of closure doesn't return a value. + * @n_param_values: The length of the @param_values array. + * @param_values: An array of #GValues holding the arguments + * on which to invoke the callback of closure. + * @invocation_hint: The invocation hint given as the last argument to + * g_closure_invoke(). + * @marshal_data: Additional data specified when registering the + * marshaller, see g_closure_set_marshal() and + * g_closure_set_meta_marshal() * - * A marshaller for a #GCClosure with a callback of type - * `void (*callback) (gpointer instance, gdouble arg1, gpointer user_data)`. + * A #GClosureMarshal function for use with signals with one + * double-precision floating point argument. */ @@ -1148,16 +1185,20 @@ /** * g_cclosure_marshal_VOID__ENUM: - * @closure: the #GClosure to which the marshaller belongs - * @return_value: ignored - * @n_param_values: 2 - * @param_values: a #GValue array holding the instance and the enumeration parameter - * @invocation_hint: the invocation hint given as the last argument - * to g_closure_invoke() - * @marshal_data: additional data specified when registering the marshaller + * @closure: A #GClosure. + * @return_value: A #GValue to store the return value. May be %NULL + * if the callback of closure doesn't return a value. + * @n_param_values: The length of the @param_values array. + * @param_values: An array of #GValues holding the arguments + * on which to invoke the callback of closure. + * @invocation_hint: The invocation hint given as the last argument to + * g_closure_invoke(). + * @marshal_data: Additional data specified when registering the + * marshaller, see g_closure_set_marshal() and + * g_closure_set_meta_marshal() * - * A marshaller for a #GCClosure with a callback of type - * `void (*callback) (gpointer instance, gint arg1, gpointer user_data)` where the #gint parameter denotes an enumeration type.. + * A #GClosureMarshal function for use with signals with a single + * argument with an enumerated type. */ @@ -1182,16 +1223,20 @@ /** * g_cclosure_marshal_VOID__FLAGS: - * @closure: the #GClosure to which the marshaller belongs - * @return_value: ignored - * @n_param_values: 2 - * @param_values: a #GValue array holding the instance and the flags parameter - * @invocation_hint: the invocation hint given as the last argument - * to g_closure_invoke() - * @marshal_data: additional data specified when registering the marshaller + * @closure: A #GClosure. + * @return_value: A #GValue to store the return value. May be %NULL + * if the callback of closure doesn't return a value. + * @n_param_values: The length of the @param_values array. + * @param_values: An array of #GValues holding the arguments + * on which to invoke the callback of closure. + * @invocation_hint: The invocation hint given as the last argument to + * g_closure_invoke(). + * @marshal_data: Additional data specified when registering the + * marshaller, see g_closure_set_marshal() and + * g_closure_set_meta_marshal() * - * A marshaller for a #GCClosure with a callback of type - * `void (*callback) (gpointer instance, gint arg1, gpointer user_data)` where the #gint parameter denotes a flags type. + * A #GClosureMarshal function for use with signals with a single + * argument with a flags types. */ @@ -1216,16 +1261,20 @@ /** * g_cclosure_marshal_VOID__FLOAT: - * @closure: the #GClosure to which the marshaller belongs - * @return_value: ignored - * @n_param_values: 2 - * @param_values: a #GValue array holding the instance and the #gfloat parameter - * @invocation_hint: the invocation hint given as the last argument - * to g_closure_invoke() - * @marshal_data: additional data specified when registering the marshaller + * @closure: A #GClosure. + * @return_value: A #GValue to store the return value. May be %NULL + * if the callback of closure doesn't return a value. + * @n_param_values: The length of the @param_values array. + * @param_values: An array of #GValues holding the arguments + * on which to invoke the callback of closure. + * @invocation_hint: The invocation hint given as the last argument to + * g_closure_invoke(). + * @marshal_data: Additional data specified when registering the + * marshaller, see g_closure_set_marshal() and + * g_closure_set_meta_marshal() * - * A marshaller for a #GCClosure with a callback of type - * `void (*callback) (gpointer instance, gfloat arg1, gpointer user_data)`. + * A #GClosureMarshal function for use with signals with one + * single-precision floating point argument. */ @@ -1250,16 +1299,20 @@ /** * g_cclosure_marshal_VOID__INT: - * @closure: the #GClosure to which the marshaller belongs - * @return_value: ignored - * @n_param_values: 2 - * @param_values: a #GValue array holding the instance and the #gint parameter - * @invocation_hint: the invocation hint given as the last argument - * to g_closure_invoke() - * @marshal_data: additional data specified when registering the marshaller + * @closure: A #GClosure. + * @return_value: A #GValue to store the return value. May be %NULL + * if the callback of closure doesn't return a value. + * @n_param_values: The length of the @param_values array. + * @param_values: An array of #GValues holding the arguments + * on which to invoke the callback of closure. + * @invocation_hint: The invocation hint given as the last argument to + * g_closure_invoke(). + * @marshal_data: Additional data specified when registering the + * marshaller, see g_closure_set_marshal() and + * g_closure_set_meta_marshal() * - * A marshaller for a #GCClosure with a callback of type - * `void (*callback) (gpointer instance, gint arg1, gpointer user_data)`. + * A #GClosureMarshal function for use with signals with a single + * integer argument. */ @@ -1284,16 +1337,20 @@ /** * g_cclosure_marshal_VOID__LONG: - * @closure: the #GClosure to which the marshaller belongs - * @return_value: ignored - * @n_param_values: 2 - * @param_values: a #GValue array holding the instance and the #glong parameter - * @invocation_hint: the invocation hint given as the last argument - * to g_closure_invoke() - * @marshal_data: additional data specified when registering the marshaller + * @closure: A #GClosure. + * @return_value: A #GValue to store the return value. May be %NULL + * if the callback of closure doesn't return a value. + * @n_param_values: The length of the @param_values array. + * @param_values: An array of #GValues holding the arguments + * on which to invoke the callback of closure. + * @invocation_hint: The invocation hint given as the last argument to + * g_closure_invoke(). + * @marshal_data: Additional data specified when registering the + * marshaller, see g_closure_set_marshal() and + * g_closure_set_meta_marshal() * - * A marshaller for a #GCClosure with a callback of type - * `void (*callback) (gpointer instance, glong arg1, gpointer user_data)`. + * A #GClosureMarshal function for use with signals with with a single + * long integer argument. */ @@ -1318,16 +1375,20 @@ /** * g_cclosure_marshal_VOID__OBJECT: - * @closure: the #GClosure to which the marshaller belongs - * @return_value: ignored - * @n_param_values: 2 - * @param_values: a #GValue array holding the instance and the #GObject* parameter - * @invocation_hint: the invocation hint given as the last argument - * to g_closure_invoke() - * @marshal_data: additional data specified when registering the marshaller + * @closure: A #GClosure. + * @return_value: A #GValue to store the return value. May be %NULL + * if the callback of closure doesn't return a value. + * @n_param_values: The length of the @param_values array. + * @param_values: An array of #GValues holding the arguments + * on which to invoke the callback of closure. + * @invocation_hint: The invocation hint given as the last argument to + * g_closure_invoke(). + * @marshal_data: Additional data specified when registering the + * marshaller, see g_closure_set_marshal() and + * g_closure_set_meta_marshal() * - * A marshaller for a #GCClosure with a callback of type - * `void (*callback) (gpointer instance, GObject *arg1, gpointer user_data)`. + * A #GClosureMarshal function for use with signals with a single + * #GObject argument. */ @@ -1352,16 +1413,20 @@ /** * g_cclosure_marshal_VOID__PARAM: - * @closure: the #GClosure to which the marshaller belongs - * @return_value: ignored - * @n_param_values: 2 - * @param_values: a #GValue array holding the instance and the #GParamSpec* parameter - * @invocation_hint: the invocation hint given as the last argument - * to g_closure_invoke() - * @marshal_data: additional data specified when registering the marshaller + * @closure: A #GClosure. + * @return_value: A #GValue to store the return value. May be %NULL + * if the callback of closure doesn't return a value. + * @n_param_values: The length of the @param_values array. + * @param_values: An array of #GValues holding the arguments + * on which to invoke the callback of closure. + * @invocation_hint: The invocation hint given as the last argument to + * g_closure_invoke(). + * @marshal_data: Additional data specified when registering the + * marshaller, see g_closure_set_marshal() and + * g_closure_set_meta_marshal() * - * A marshaller for a #GCClosure with a callback of type - * `void (*callback) (gpointer instance, GParamSpec *arg1, gpointer user_data)`. + * A #GClosureMarshal function for use with signals with a single + * argument of type #GParamSpec. */ @@ -1386,16 +1451,24 @@ /** * g_cclosure_marshal_VOID__POINTER: - * @closure: the #GClosure to which the marshaller belongs - * @return_value: ignored - * @n_param_values: 2 - * @param_values: a #GValue array holding the instance and the #gpointer parameter - * @invocation_hint: the invocation hint given as the last argument - * to g_closure_invoke() - * @marshal_data: additional data specified when registering the marshaller + * @closure: A #GClosure. + * @return_value: A #GValue to store the return value. May be %NULL + * if the callback of closure doesn't return a value. + * @n_param_values: The length of the @param_values array. + * @param_values: An array of #GValues holding the arguments + * on which to invoke the callback of closure. + * @invocation_hint: The invocation hint given as the last argument to + * g_closure_invoke(). + * @marshal_data: Additional data specified when registering the + * marshaller, see g_closure_set_marshal() and + * g_closure_set_meta_marshal() * - * A marshaller for a #GCClosure with a callback of type - * `void (*callback) (gpointer instance, gpointer arg1, gpointer user_data)`. + * A #GClosureMarshal function for use with signals with a single raw + * pointer argument type. + * + * If it is possible, it is better to use one of the more specific + * functions such as g_cclosure_marshal_VOID__OBJECT() or + * g_cclosure_marshal_VOID__OBJECT(). */ @@ -1420,16 +1493,20 @@ /** * g_cclosure_marshal_VOID__STRING: - * @closure: the #GClosure to which the marshaller belongs - * @return_value: ignored - * @n_param_values: 2 - * @param_values: a #GValue array holding the instance and the #gchar* parameter - * @invocation_hint: the invocation hint given as the last argument - * to g_closure_invoke() - * @marshal_data: additional data specified when registering the marshaller + * @closure: A #GClosure. + * @return_value: A #GValue to store the return value. May be %NULL + * if the callback of closure doesn't return a value. + * @n_param_values: The length of the @param_values array. + * @param_values: An array of #GValues holding the arguments + * on which to invoke the callback of closure. + * @invocation_hint: The invocation hint given as the last argument to + * g_closure_invoke(). + * @marshal_data: Additional data specified when registering the + * marshaller, see g_closure_set_marshal() and + * g_closure_set_meta_marshal() * - * A marshaller for a #GCClosure with a callback of type - * `void (*callback) (gpointer instance, const gchar *arg1, gpointer user_data)`. + * A #GClosureMarshal function for use with signals with a single string + * argument. */ @@ -1454,16 +1531,20 @@ /** * g_cclosure_marshal_VOID__UCHAR: - * @closure: the #GClosure to which the marshaller belongs - * @return_value: ignored - * @n_param_values: 2 - * @param_values: a #GValue array holding the instance and the #guchar parameter - * @invocation_hint: the invocation hint given as the last argument - * to g_closure_invoke() - * @marshal_data: additional data specified when registering the marshaller + * @closure: A #GClosure. + * @return_value: A #GValue to store the return value. May be %NULL + * if the callback of closure doesn't return a value. + * @n_param_values: The length of the @param_values array. + * @param_values: An array of #GValues holding the arguments + * on which to invoke the callback of closure. + * @invocation_hint: The invocation hint given as the last argument to + * g_closure_invoke(). + * @marshal_data: Additional data specified when registering the + * marshaller, see g_closure_set_marshal() and + * g_closure_set_meta_marshal() * - * A marshaller for a #GCClosure with a callback of type - * `void (*callback) (gpointer instance, guchar arg1, gpointer user_data)`. + * A #GClosureMarshal function for use with signals with a single + * unsigned character argument. */ @@ -1488,31 +1569,39 @@ /** * g_cclosure_marshal_VOID__UINT: - * @closure: the #GClosure to which the marshaller belongs - * @return_value: ignored - * @n_param_values: 2 - * @param_values: a #GValue array holding the instance and the #guint parameter - * @invocation_hint: the invocation hint given as the last argument - * to g_closure_invoke() - * @marshal_data: additional data specified when registering the marshaller + * @closure: A #GClosure. + * @return_value: A #GValue to store the return value. May be %NULL + * if the callback of closure doesn't return a value. + * @n_param_values: The length of the @param_values array. + * @param_values: An array of #GValues holding the arguments + * on which to invoke the callback of closure. + * @invocation_hint: The invocation hint given as the last argument to + * g_closure_invoke(). + * @marshal_data: Additional data specified when registering the + * marshaller, see g_closure_set_marshal() and + * g_closure_set_meta_marshal() * - * A marshaller for a #GCClosure with a callback of type - * `void (*callback) (gpointer instance, guint arg1, gpointer user_data)`. + * A #GClosureMarshal function for use with signals with with a single + * unsigned integer argument. */ /** * g_cclosure_marshal_VOID__UINT_POINTER: - * @closure: the #GClosure to which the marshaller belongs - * @return_value: ignored - * @n_param_values: 3 - * @param_values: a #GValue array holding instance, arg1 and arg2 - * @invocation_hint: the invocation hint given as the last argument - * to g_closure_invoke() - * @marshal_data: additional data specified when registering the marshaller + * @closure: A #GClosure. + * @return_value: A #GValue to store the return value. May be %NULL + * if the callback of closure doesn't return a value. + * @n_param_values: The length of the @param_values array. + * @param_values: An array of #GValues holding the arguments + * on which to invoke the callback of closure. + * @invocation_hint: The invocation hint given as the last argument to + * g_closure_invoke(). + * @marshal_data: Additional data specified when registering the + * marshaller, see g_closure_set_marshal() and + * g_closure_set_meta_marshal() * - * A marshaller for a #GCClosure with a callback of type - * `void (*callback) (gpointer instance, guint arg1, gpointer arg2, gpointer user_data)`. + * A #GClosureMarshal function for use with signals with a unsigned int + * and a pointer as arguments. */ @@ -1556,16 +1645,20 @@ /** * g_cclosure_marshal_VOID__ULONG: - * @closure: the #GClosure to which the marshaller belongs - * @return_value: ignored - * @n_param_values: 2 - * @param_values: a #GValue array holding the instance and the #gulong parameter - * @invocation_hint: the invocation hint given as the last argument - * to g_closure_invoke() - * @marshal_data: additional data specified when registering the marshaller + * @closure: A #GClosure. + * @return_value: A #GValue to store the return value. May be %NULL + * if the callback of closure doesn't return a value. + * @n_param_values: The length of the @param_values array. + * @param_values: An array of #GValues holding the arguments + * on which to invoke the callback of closure. + * @invocation_hint: The invocation hint given as the last argument to + * g_closure_invoke(). + * @marshal_data: Additional data specified when registering the + * marshaller, see g_closure_set_marshal() and + * g_closure_set_meta_marshal() * - * A marshaller for a #GCClosure with a callback of type - * `void (*callback) (gpointer instance, gulong arg1, gpointer user_data)`. + * A #GClosureMarshal function for use with signals with a single + * unsigned long integer argument. */ @@ -1590,18 +1683,20 @@ /** * g_cclosure_marshal_VOID__VARIANT: - * @closure: the #GClosure to which the marshaller belongs - * @return_value: ignored - * @n_param_values: 2 - * @param_values: a #GValue array holding the instance and the #GVariant* parameter - * @invocation_hint: the invocation hint given as the last argument - * to g_closure_invoke() - * @marshal_data: additional data specified when registering the marshaller - * - * A marshaller for a #GCClosure with a callback of type - * `void (*callback) (gpointer instance, GVariant *arg1, gpointer user_data)`. + * @closure: A #GClosure. + * @return_value: A #GValue to store the return value. May be %NULL + * if the callback of closure doesn't return a value. + * @n_param_values: The length of the @param_values array. + * @param_values: An array of #GValues holding the arguments + * on which to invoke the callback of closure. + * @invocation_hint: The invocation hint given as the last argument to + * g_closure_invoke(). + * @marshal_data: Additional data specified when registering the + * marshaller, see g_closure_set_marshal() and + * g_closure_set_meta_marshal() * - * Since: 2.26 + * A #GClosureMarshal function for use with signals with a single + * #GVariant argument. */ @@ -1626,16 +1721,19 @@ /** * g_cclosure_marshal_VOID__VOID: - * @closure: the #GClosure to which the marshaller belongs - * @return_value: ignored - * @n_param_values: 1 - * @param_values: a #GValue array holding only the instance - * @invocation_hint: the invocation hint given as the last argument - * to g_closure_invoke() - * @marshal_data: additional data specified when registering the marshaller + * @closure: A #GClosure. + * @return_value: A #GValue to store the return value. May be %NULL + * if the callback of closure doesn't return a value. + * @n_param_values: The length of the @param_values array. + * @param_values: An array of #GValues holding the arguments + * on which to invoke the callback of closure. + * @invocation_hint: The invocation hint given as the last argument to + * g_closure_invoke(). + * @marshal_data: Additional data specified when registering the + * marshaller, see g_closure_set_marshal() and + * g_closure_set_meta_marshal() * - * A marshaller for a #GCClosure with a callback of type - * `void (*callback) (gpointer instance, gpointer user_data)`. + * A #GClosureMarshal function for use with signals with no arguments. */ @@ -3436,11 +3534,11 @@ /** * g_param_spec_get_default_value: - * @param: a #GParamSpec + * @pspec: a #GParamSpec * - * Gets the default value of @param as a pointer to a #GValue. + * Gets the default value of @pspec as a pointer to a #GValue. * - * The #GValue will remain value for the life of @param. + * The #GValue will remain value for the life of @pspec. * * Returns: a pointer to a #GValue which must not be modified * Since: 2.38 @@ -3460,6 +3558,17 @@ */ +/** + * g_param_spec_get_name_quark: + * @param: a #GParamSpec + * + * Gets the GQuark for the name. + * + * Returns: the GQuark for @pspec->name. + * Since: 2.46 + */ + + /** * g_param_spec_get_nick: * @pspec: a valid #GParamSpec diff -Nru gobject-introspection-1.45.4/giscanner/ccompiler.py gobject-introspection-1.46.0/giscanner/ccompiler.py --- gobject-introspection-1.45.4/giscanner/ccompiler.py 2015-07-30 18:41:15.000000000 +0000 +++ gobject-introspection-1.46.0/giscanner/ccompiler.py 2015-09-09 10:20:37.000000000 +0000 @@ -25,6 +25,7 @@ import distutils from distutils.msvccompiler import MSVCCompiler +from distutils.unixccompiler import UnixCCompiler from distutils.cygwinccompiler import Mingw32CCompiler from distutils.sysconfig import customize_compiler @@ -72,7 +73,7 @@ self.compiler = distutils.ccompiler.new_compiler(compiler=compiler_name) customize_compiler(self.compiler) - # customize_compiler from distutils only does customization + # customize_compiler() from distutils only does customization # for 'unix' compiler type. Also, avoid linking to msvcrxx.dll # for MinGW builds as the dumper binary does not link to the # Python DLL, but link to msvcrt.dll if necessary. @@ -102,7 +103,7 @@ if (isinstance(self.compiler, Mingw32CCompiler)): self.compiler_cmd = self.compiler.compiler[0] else: - self.compiler_cmd = ''.join(self.compiler.executables['compiler']) + self.compiler_cmd = ' '.join(self.compiler.compiler) self._cflags_no_deprecation_warnings = "-Wno-deprecated-declarations" @@ -110,45 +111,60 @@ # An "internal" link is where the library to be introspected # is being built in the current directory. - # Search the current directory first - # (This flag is not supported nor needed for Visual C++) - if not self.check_is_msvc(): - args.append('-L.') + if not libtool: + # non-libtool case: prepare distutils use + if self.check_is_msvc(): + for library in libraries: + # MSVC Builds don't use libtool, so no .la libraries, + # so just add the library directly. + self.compiler.add_library(library) + for libpath in libpaths: + self.compiler.add_library_dir(libpath) + else: + # Search the current directory first + # (This flag is not supported nor needed for Visual C++) + self.compiler.add_library_dir('.') + if os.name != 'nt': + self.compiler.add_runtime_library_dir('.') - # https://bugzilla.gnome.org/show_bug.cgi?id=625195 - if not libtool: + # https://bugzilla.gnome.org/show_bug.cgi?id=625195 args.append('-Wl,-rpath=.') + + # Ensure libraries are always linked as we are going to use ldd to work + # out their names later args.append('-Wl,--no-as-needed') - for library in libraries: - if self.check_is_msvc(): - args.append(library + '.lib') - else: + for library in libraries: + self.compiler.add_library(library) + if not self.check_is_msvc(): + for library_path in libpaths: + args.append('-L' + library_path) + if os.path.isabs(library_path): + args.append('-Wl,-rpath=' + library_path) + + else: + # libtool case: assemble linker command arguments, like we did before + args.append('-L.') + for library in libraries: if library.endswith(".la"): # explicitly specified libtool library args.append(library) else: args.append('-l' + library) - for library_path in libpaths: - # Not used/needed on Visual C++, and -Wl,-rpath options - # will cause grief - if not self.check_is_msvc(): + for library_path in libpaths: args.append('-L' + library_path) if os.path.isabs(library_path): - if libtool: - args.append('-rpath') - args.append(library_path) - else: - args.append('-Wl,-rpath=' + library_path) + args.append('-rpath') + args.append(library_path) - def get_external_link_flags(self, args, libraries): + def get_external_link_flags(self, args, libtool, libraries): # An "external" link is where the library to be introspected # is installed on the system; this case is used for the scanning # of GLib in gobject-introspection itself. for library in libraries: - if self.check_is_msvc(): - args.append(library + '.lib') + if not libtool: + self.compiler.add_library(library) else: if library.endswith(".la"): # explicitly specified libtool library args.append(library) @@ -180,6 +196,64 @@ include_dirs=include_dirs, extra_postargs=extra_postargs) + def compile(self, pkg_config_cflags, cpp_includes, source, init_sections): + extra_postargs = [] + includes = [] + source_str = ''.join(source) + tmpdir_idx = source_str.rfind(os.sep, 0, source_str.rfind(os.sep)) + (include_paths, macros, extra_args) = \ + self._set_cpp_options(pkg_config_cflags) + + for include in cpp_includes: + includes.append(include) + + if isinstance(self.compiler, UnixCCompiler): + # This is to handle the case where macros are defined in CFLAGS + cflags = os.environ.get('CFLAGS') + if cflags: + for i, cflag in enumerate(cflags.split()): + if cflag.startswith('-D'): + stridx = cflag.find('=') + if stridx > -1: + macroset = (cflag[2:stridx], + cflag[stridx + 1:]) + else: + macroset = (cflag[2:], None) + if macroset not in macros: + macros.append(macroset) + + # Do not add -Wall when using init code as we do not include any + # header of the library being introspected + if self.compiler_cmd == 'gcc' and not init_sections: + extra_postargs.append('-Wall') + extra_postargs.append(self._cflags_no_deprecation_warnings) + + includes.extend(include_paths) + extra_postargs.extend(extra_args) + + return self.compiler.compile(sources=source, + macros=macros, + include_dirs=includes, + extra_postargs=extra_postargs, + output_dir=source_str[tmpdir_idx + 1: + source_str.rfind(os.sep)]) + + def link(self, output, objects, lib_args): + # Note: This is used for non-libtool builds only! + extra_preargs = [] + extra_postargs = [] + library_dirs = [] + libraries = [] + + for arg in lib_args: + extra_postargs.append(arg) + + self.compiler.link(target_desc=self.compiler.EXECUTABLE, + objects=objects, + output_filename=output, + extra_preargs=extra_preargs, + extra_postargs=extra_postargs) + def resolve_windows_libs(self, libraries, options): args = [] libsearch = [] diff -Nru gobject-introspection-1.45.4/giscanner/dumper.py gobject-introspection-1.46.0/giscanner/dumper.py --- gobject-introspection-1.45.4/giscanner/dumper.py 2015-08-21 12:03:01.000000000 +0000 +++ gobject-introspection-1.46.0/giscanner/dumper.py 2015-09-09 10:20:37.000000000 +0000 @@ -24,6 +24,7 @@ import subprocess import shutil import tempfile +from distutils.errors import LinkError from .gdumpparser import IntrospectionBinary from . import utils @@ -92,7 +93,10 @@ self._uninst_srcdir = os.environ.get('UNINSTALLED_INTROSPECTION_SRCDIR') self._packages = ['gio-2.0 gmodule-2.0'] self._packages.extend(options.packages) - self._linker_cmd = os.environ.get('CC', 'cc') + if hasattr(self._compiler.compiler, 'linker_exe'): + self._linker_cmd = self._compiler.compiler.linker_exe + else: + self._linker_cmd = [] # Public API @@ -147,29 +151,22 @@ f.write(" " + func) f.write("\n};\n") - # Microsoft compilers generate intermediate .obj files - # during compilation, unlike .o files like GCC and others - if self._compiler.check_is_msvc(): - o_path = self._generate_tempfile(tmpdir, '.obj') - else: - o_path = self._generate_tempfile(tmpdir, '.o') - - if os.name == 'nt': - ext = '.exe' + if self._compiler.compiler.exe_extension: + ext = self._compiler.compiler.exe_extension else: ext = '' bin_path = self._generate_tempfile(tmpdir, ext) try: - self._compile(o_path, c_path) + introspection_obj = self._compile(c_path) except CompilerError as e: if not utils.have_debug_flag('save-temps'): shutil.rmtree(tmpdir) raise SystemExit('compilation of temporary binary failed:' + str(e)) try: - self._link(bin_path, o_path) + self._link(bin_path, introspection_obj) except LinkerError as e: if not utils.have_debug_flag('save-temps'): shutil.rmtree(tmpdir) @@ -196,91 +193,59 @@ stdout=subprocess.PIPE) return proc.communicate()[0].split() - def _compile(self, output, *sources): - # Not strictly speaking correct, but easier than parsing shell - args = self._compiler.compiler_cmd.split() - # Do not add -Wall when using init code as we do not include any - # header of the library being introspected - if self._compiler.compiler_cmd == 'gcc' and not self._options.init_sections: - args.append('-Wall') - # The Microsoft compiler uses different option flags for - # silencing warnings on deprecated function usage - if self._compiler.check_is_msvc(): - args.append("-wd4996") - else: - args.append("-Wno-deprecated-declarations") + def _compile(self, *sources): pkgconfig_flags = self._run_pkgconfig('--cflags') - args.extend([utils.cflag_real_include_path(f) for f in pkgconfig_flags]) - cppflags = os.environ.get('CPPFLAGS', '') - for cppflag in cppflags.split(): - args.append(cppflag) - cflags = os.environ.get('CFLAGS', '') - for cflag in cflags.split(): - args.append(cflag) - for include in self._options.cpp_includes: - args.append('-I' + include) - # The Microsoft compiler uses different option flags for - # compilation result output - if self._compiler.check_is_msvc(): - args.extend(['-c', '-Fe' + output, '-Fo' + output]) - else: - args.extend(['-c', '-o', output]) - for source in sources: - if not os.path.exists(source): - raise CompilerError( - "Could not find c source file: %s" % (source, )) - args.extend(list(sources)) - if not self._options.quiet: - print "g-ir-scanner: compile: %s" % ( - subprocess.list2cmdline(args), ) - sys.stdout.flush() - try: - subprocess.check_call(args) - except subprocess.CalledProcessError as e: - raise CompilerError(e) + return self._compiler.compile(pkgconfig_flags, + self._options.cpp_includes, + sources, + self._options.init_sections) - def _link(self, output, *sources): + def _link(self, output, sources): args = [] libtool = utils.get_libtool_command(self._options) if libtool: + # Note: MSVC Builds do not use libtool! + # In the libtool case, put together the linker command, as we did before. + # We aren't using distutils to link in this case. args.extend(libtool) args.append('--mode=link') args.append('--tag=CC') if self._options.quiet: args.append('--silent') - args.extend(self._linker_cmd.split()) - # We can use -o for the Microsoft compiler/linker, - # but it is considered deprecated usage with that - if self._compiler.check_is_msvc(): - args.extend(['-Fe' + output]) - else: + args.extend(self._linker_cmd) + args.extend(['-o', output]) - if libtool: if os.name == 'nt': args.append('-Wl,--export-all-symbols') else: args.append('-export-dynamic') - cppflags = os.environ.get('CPPFLAGS', '') - for cppflag in cppflags.split(): - args.append(cppflag) - cflags = os.environ.get('CFLAGS', '') - for cflag in cflags.split(): - args.append(cflag) - ldflags = os.environ.get('LDFLAGS', '') - for ldflag in ldflags.split(): - args.append(ldflag) + if not self._compiler.check_is_msvc(): + # These envvars are not used for MSVC Builds! + # MSVC Builds use the INCLUDE, LIB envvars, + # which are automatically picked up during + # compilation and linking + cppflags = os.environ.get('CPPFLAGS', '') + for cppflag in cppflags.split(): + args.append(cppflag) + cflags = os.environ.get('CFLAGS', '') + for cflag in cflags.split(): + args.append(cflag) + ldflags = os.environ.get('LDFLAGS', '') + for ldflag in ldflags.split(): + args.append(ldflag) # Make sure to list the library to be introspected first since it's # likely to be uninstalled yet and we want the uninstalled RPATHs have # priority (or we might run with installed library that is older) - for source in sources: if not os.path.exists(source): raise CompilerError( "Could not find object file: %s" % (source, )) - args.extend(list(sources)) + + if libtool: + args.extend(sources) pkg_config_libs = self._run_pkgconfig('--libs') @@ -293,31 +258,61 @@ else: args.extend(pkg_config_libs) - self._compiler.get_external_link_flags(args, self._options.libraries) + self._compiler.get_external_link_flags(args, + libtool, + self._options.libraries) - if not self._options.quiet: - print "g-ir-scanner: link: %s" % ( - subprocess.list2cmdline(args), ) - sys.stdout.flush() - msys = os.environ.get('MSYSTEM', None) - if msys: - shell = os.environ.get('SHELL', 'sh.exe') - # Create a temporary script file that - # runs the command we want - tf, tf_name = tempfile.mkstemp() - with os.fdopen(tf, 'wb') as f: - shellcontents = ' '.join([x.replace('\\', '/') for x in args]) - fcontents = '#!/bin/sh\nunset PWD\n{}\n'.format(shellcontents) - f.write(fcontents) - shell = utils.which(shell) - args = [shell, tf_name.replace('\\', '/')] - try: - subprocess.check_call(args) - except subprocess.CalledProcessError as e: - raise LinkerError(e) - finally: + if not libtool: + # non-libtool: prepare distutils for linking the introspection + # dumper program... + try: + self._compiler.link(output, + sources, + args) + + # Ignore failing to embed the manifest files, when the manifest + # file does not exist, especially for MSVC 2010 and later builds. + # If we are on Visual C++ 2005/2008, where + # this embedding is required, the build will fail anyway, as + # the dumper program will likely fail to run, and this means + # something went wrong with the build. + except LinkError, e: + if self._compiler.check_is_msvc(): + msg = str(e) + + if msg[msg.rfind('mt.exe'):] == 'mt.exe\' failed with exit status 31': + sys.exc_clear() + pass + else: + raise LinkError(e) + else: + raise LinkError(e) + else: + # libtool: Run the assembled link command, we don't use distutils + # for linking here. + if not self._options.quiet: + print "g-ir-scanner: link: %s" % ( + subprocess.list2cmdline(args), ) + sys.stdout.flush() + msys = os.environ.get('MSYSTEM', None) if msys: - os.remove(tf_name) + shell = os.environ.get('SHELL', 'sh.exe') + # Create a temporary script file that + # runs the command we want + tf, tf_name = tempfile.mkstemp() + with os.fdopen(tf, 'wb') as f: + shellcontents = ' '.join([x.replace('\\', '/') for x in args]) + fcontents = '#!/bin/sh\nunset PWD\n{}\n'.format(shellcontents) + f.write(fcontents) + shell = utils.which(shell) + args = [shell, tf_name.replace('\\', '/')] + try: + subprocess.check_call(args) + except subprocess.CalledProcessError as e: + raise LinkerError(e) + finally: + if msys: + os.remove(tf_name) def compile_introspection_binary(options, get_type_functions, diff -Nru gobject-introspection-1.45.4/gobject-introspection-1.0.pc gobject-introspection-1.46.0/gobject-introspection-1.0.pc --- gobject-introspection-1.45.4/gobject-introspection-1.0.pc 2015-08-21 12:36:18.000000000 +0000 +++ gobject-introspection-1.46.0/gobject-introspection-1.0.pc 2015-09-22 11:24:42.000000000 +0000 @@ -21,4 +21,4 @@ Name: gobject-introspection Description: GObject Introspection -Version: 1.45.4 +Version: 1.46.0 diff -Nru gobject-introspection-1.45.4/gobject-introspection-no-export-1.0.pc gobject-introspection-1.46.0/gobject-introspection-no-export-1.0.pc --- gobject-introspection-1.45.4/gobject-introspection-no-export-1.0.pc 2015-08-21 12:36:18.000000000 +0000 +++ gobject-introspection-1.46.0/gobject-introspection-no-export-1.0.pc 2015-09-22 11:24:42.000000000 +0000 @@ -20,4 +20,4 @@ Name: gobject-introspection Description: GObject Introspection -Version: 1.45.4 +Version: 1.46.0 diff -Nru gobject-introspection-1.45.4/tests/scanner/Regress-1.0-C-expected/Regress.func_obj_nullable_in.page gobject-introspection-1.46.0/tests/scanner/Regress-1.0-C-expected/Regress.func_obj_nullable_in.page --- gobject-introspection-1.45.4/tests/scanner/Regress-1.0-C-expected/Regress.func_obj_nullable_in.page 1970-01-01 00:00:00.000000000 +0000 +++ gobject-introspection-1.46.0/tests/scanner/Regress-1.0-C-expected/Regress.func_obj_nullable_in.page 2015-09-09 10:20:37.000000000 +0000 @@ -0,0 +1,38 @@ + + + + + + + void + + regress_func_obj_nullable_in + + RegressTestObj* + obj + + + + regress_func_obj_nullable_in + +void regress_func_obj_nullable_in (RegressTestObj* obj); + + + + + +<code>obj</code> +

A

+ + +<code>Returns</code> + + + + + diff -Nru gobject-introspection-1.45.4/tests/scanner/Regress-1.0-expected.gir gobject-introspection-1.46.0/tests/scanner/Regress-1.0-expected.gir --- gobject-introspection-1.45.4/tests/scanner/Regress-1.0-expected.gir 2015-07-18 13:27:49.000000000 +0000 +++ gobject-introspection-1.46.0/tests/scanner/Regress-1.0-expected.gir 2015-09-09 10:20:37.000000000 +0000 @@ -4761,6 +4761,21 @@ + + + + + + + A #RegressTestObj + + + + diff -Nru gobject-introspection-1.45.4/tests/scanner/Regress-1.0-Gjs-expected/Regress.func_obj_nullable_in.page gobject-introspection-1.46.0/tests/scanner/Regress-1.0-Gjs-expected/Regress.func_obj_nullable_in.page --- gobject-introspection-1.45.4/tests/scanner/Regress-1.0-Gjs-expected/Regress.func_obj_nullable_in.page 1970-01-01 00:00:00.000000000 +0000 +++ gobject-introspection-1.46.0/tests/scanner/Regress-1.0-Gjs-expected/Regress.func_obj_nullable_in.page 2015-09-09 10:20:37.000000000 +0000 @@ -0,0 +1,36 @@ + + + + + + + void + + regress_func_obj_nullable_in + + Regress.TestObj + obj + + + + Regress.func_obj_nullable_in + +function func_obj_nullable_in(obj: Regress.TestObj): void { + // Gjs wrapper for regress_func_obj_nullable_in() +} + + + + + +<code>obj</code> +

A

+
+
+ +
diff -Nru gobject-introspection-1.45.4/tests/scanner/Regress-1.0-Python-expected/Regress.func_obj_nullable_in.page gobject-introspection-1.46.0/tests/scanner/Regress-1.0-Python-expected/Regress.func_obj_nullable_in.page --- gobject-introspection-1.45.4/tests/scanner/Regress-1.0-Python-expected/Regress.func_obj_nullable_in.page 1970-01-01 00:00:00.000000000 +0000 +++ gobject-introspection-1.46.0/tests/scanner/Regress-1.0-Python-expected/Regress.func_obj_nullable_in.page 2015-09-09 10:20:37.000000000 +0000 @@ -0,0 +1,37 @@ + + + + + + + none + + regress_func_obj_nullable_in + + Regress.TestObj + obj + + + + Regress.func_obj_nullable_in + +@accepts(Regress.TestObj) +@returns(none) +def func_obj_nullable_in(obj): + # Python wrapper for regress_func_obj_nullable_in() + + + + + +<code>obj</code> +

A

+
+
+ +
diff -Nru gobject-introspection-1.45.4/tests/scanner/Regress-1.0-sections-expected.txt gobject-introspection-1.46.0/tests/scanner/Regress-1.0-sections-expected.txt --- gobject-introspection-1.45.4/tests/scanner/Regress-1.0-sections-expected.txt 2015-07-18 13:27:49.000000000 +0000 +++ gobject-introspection-1.46.0/tests/scanner/Regress-1.0-sections-expected.txt 2015-09-09 10:20:37.000000000 +0000 @@ -46,6 +46,7 @@ regress_foo_test_varargs_callback2 regress_foo_test_varargs_callback3 regress_func_obj_null_in +regress_func_obj_nullable_in regress_global_get_flags_out regress_has_parameter_named_attrs regress_introspectable_via_alias diff -Nru gobject-introspection-1.45.4/tests/scanner/regress.c gobject-introspection-1.46.0/tests/scanner/regress.c --- gobject-introspection-1.45.4/tests/scanner/regress.c 2015-07-18 13:27:49.000000000 +0000 +++ gobject-introspection-1.46.0/tests/scanner/regress.c 2015-09-09 10:20:37.000000000 +0000 @@ -3002,6 +3002,15 @@ } /** + * regress_func_obj_nullable_in: + * @obj: (nullable): A #RegressTestObj + */ +void +regress_func_obj_nullable_in (RegressTestObj *obj) +{ +} + +/** * regress_test_array_fixed_out_objects: * @objs: (out) (array fixed-size=2) (transfer full): An array of #RegressTestObj */ diff -Nru gobject-introspection-1.45.4/tests/scanner/regress.h gobject-introspection-1.46.0/tests/scanner/regress.h --- gobject-introspection-1.45.4/tests/scanner/regress.h 2015-07-18 13:27:49.000000000 +0000 +++ gobject-introspection-1.46.0/tests/scanner/regress.h 2015-09-09 10:20:37.000000000 +0000 @@ -918,6 +918,8 @@ _GI_TEST_EXTERN void regress_test_obj_null_out (RegressTestObj **obj); +void regress_func_obj_nullable_in (RegressTestObj *obj); + /* inheritance */ #define REGRESS_TEST_TYPE_SUB_OBJ (regress_test_sub_obj_get_type ()) #define REGRESS_TEST_SUB_OBJECT(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), REGRESS_TEST_TYPE_SUB_OBJ, RegressTestSubObj))