diff options
author | Murray Cumming <murrayc@murrayc.com> | 2016-05-09 12:33:12 +0200 |
---|---|---|
committer | Murray Cumming <murrayc@murrayc.com> | 2016-05-09 12:33:12 +0200 |
commit | 1bd61e69afed88b1ffc9e46370b415397d530c0e (patch) | |
tree | b2a42e0c2318d1d851f7850a7c200859f45ae972 | |
parent | 60bc4839dd957cd3ce4688cab4a4d189233b7ba8 (diff) | |
download | glibmm-1bd61e69afed88b1ffc9e46370b415397d530c0e.tar.gz |
Gio::SocketAddress: Hand-code create() because the C func does lots.
We can only genereate constructors (that are then called by generated
create() methods) when the C function just sets its properties, as per
the convention with GObject APIs. This C function does far more.
Bug #766150 (Vladimir)
-rw-r--r-- | gio/src/socketaddress.hg | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/gio/src/socketaddress.hg b/gio/src/socketaddress.hg index 2739673d..ed7cf8fc 100644 --- a/gio/src/socketaddress.hg +++ b/gio/src/socketaddress.hg @@ -41,10 +41,13 @@ class SocketAddress : public Glib::Object, _CLASS_GOBJECT(SocketAddress, GSocketAddress, G_SOCKET_ADDRESS, Glib::Object, GObject) _IMPLEMENTS_INTERFACE(SocketConnectable) - _WRAP_CTOR(SocketAddress(gpointer native, gsize len), g_socket_address_new_from_native) - public: - _WRAP_CREATE(gpointer native, gsize len) + + // Note that we can't use _WRAP_CTOR() and _WRAP_CREATE() because the C + // function does more than just call g_object_new(): + // See https://bugzilla.gnome.org/show_bug.cgi?id=766150 + _WRAP_METHOD(static Glib::RefPtr<SocketAddress> create(gpointer native, gsize len), g_socket_address_new_from_native) + _WRAP_METHOD(SocketFamily get_family() const, g_socket_address_get_family) _WRAP_METHOD(bool to_native(gpointer dest, gsize destlen), g_socket_address_to_native, errthrow) _WRAP_METHOD(gssize get_native_size() const, g_socket_address_get_native_size) |