diff options
author | Jonathon Jongsma <jonathon@quotidian.org> | 2009-07-09 12:05:40 +0100 |
---|---|---|
committer | Jonathon Jongsma <jonathon@quotidian.org> | 2009-07-09 12:05:40 +0100 |
commit | 2be6461562f696845a60370568dedd7625b6dbf3 (patch) | |
tree | 25af2feb5389dcf49cf21c1baafe21ad0a29225c /gio/src/socket.hg | |
parent | 8a7805cbbe6d268e975669349beb4e82d971537d (diff) | |
download | glibmm-2be6461562f696845a60370568dedd7625b6dbf3.tar.gz |
Fix build with glib from master
* gio/src/socket.hg: fix build breakage caused by the addition of a
bunch of cancellable parameters to GSocket methods.
Diffstat (limited to 'gio/src/socket.hg')
-rw-r--r-- | gio/src/socket.hg | 51 |
1 files changed, 45 insertions, 6 deletions
diff --git a/gio/src/socket.hg b/gio/src/socket.hg index d6055ba7..cbf02f10 100644 --- a/gio/src/socket.hg +++ b/gio/src/socket.hg @@ -95,33 +95,72 @@ public: _WRAP_METHOD(void bind(const Glib::RefPtr<SocketAddress>& address, bool allow_reuse), g_socket_bind, errthrow) _WRAP_METHOD(void listen(), g_socket_listen, errthrow) - _WRAP_METHOD(Glib::RefPtr<Socket> accept(), g_socket_accept, errthrow) - _WRAP_METHOD(void connect(const Glib::RefPtr<SocketAddress>& address), g_socket_connect, errthrow) + _WRAP_METHOD(Glib::RefPtr<Socket> accept(const Glib::RefPtr<Cancellable>& cancellable), g_socket_accept, errthrow) +#ifdef GLIBMM_EXCEPTIONS_ENABLED + Glib::RefPtr<Socket> accept(); +#else + Glib::RefPtr<Socket> accept(std::auto_ptr<Glib::Error>& error); +#endif //GLIBMM_EXCEPTIONS_ENABLED + + _WRAP_METHOD(void connect(const Glib::RefPtr<SocketAddress>& address, const Glib::RefPtr<Cancellable>& cancellable), g_socket_connect, errthrow) +#ifdef GLIBMM_EXCEPTIONS_ENABLED + void connect(const Glib::RefPtr<SocketAddress>& address); +#else + void connect(const Glib::RefPtr<SocketAddress>& address, std::auto_ptr<Glib::Error>& error); +#endif //GLIBMM_EXCEPTIONS_ENABLED + // FIXME: it doesn't really seem like this is a proper use of exceptions... _WRAP_METHOD(void check_connect_result(), g_socket_check_connect_result, errthrow) + // TODO: std::string overload? - _WRAP_METHOD(gssize receive(char* buffer, gsize size), g_socket_receive, errthrow) + _WRAP_METHOD(gssize receive(char* buffer, gsize size, const Glib::RefPtr<Cancellable>& cancellable), g_socket_receive, errthrow) +#ifdef GLIBMM_EXCEPTIONS_ENABLED + gssize receive(char* buffer, gsize size); +#else + gssize receive(char* buffer, gsize size, std::auto_ptr<Glib::Error>& error); +#endif //GLIBMM_EXCEPTIONS_ENABLED + // TODO: std::string overload? // TODO: need to do manually? //_WRAP_METHOD(gssize receive_from(Glib::RefPtr<SocketAddress>& address, char* buffer, gsize size), g_socket_receive_from, errthrow) // TODO: wrap receive_message -- figure out this GInputVector thing // TODO: std::string overload? - _WRAP_METHOD(gssize send(const gchar* buffer, gsize size), g_socket_send, errthrow) + + _WRAP_METHOD(gssize send(const gchar* buffer, gsize size, const Glib::RefPtr<Cancellable>& cancellable), g_socket_send, errthrow) +#ifdef GLIBMM_EXCEPTIONS_ENABLED + gssize send(const gchar* buffer, gsize size); +#else + gssize send(const gchar* buffer, gsize size, std::auto_ptr<Glib::Error>& error); +#endif //GLIBMM_EXCEPTIONS_ENABLED + // TODO: std::string overload? - _WRAP_METHOD(gssize send_to(const Glib::RefPtr<SocketAddress>& address, const char* buffer, gsize size), g_socket_send_to, errthrow) + _WRAP_METHOD(gssize send_to(const Glib::RefPtr<SocketAddress>& address, const char* buffer, gsize size, const Glib::RefPtr<Cancellable>& cancellable), g_socket_send_to, errthrow) +#ifdef GLIBMM_EXCEPTIONS_ENABLED + gssize send_to(const Glib::RefPtr<SocketAddress>& address, const char* buffer, gsize size); +#else + gssize send_to(const Glib::RefPtr<SocketAddress>& address, const char* buffer, gsize size, std::auto_ptr<Glib::Error>& error); +#endif //GLIBMM_EXCEPTIONS_ENABLED + // TODO: wrap send_message -- figure out this GOutputVector thing _WRAP_METHOD(void close(), g_socket_close, errthrow) _WRAP_METHOD(bool is_closed(), g_socket_is_closed) _WRAP_METHOD(void shutdown(bool shutdown_read, bool shutdown_write), g_socket_shutdown, errthrow) _WRAP_METHOD(bool is_connected(), g_socket_is_connected) + // TODO: non-cancellable version // This won't work because Glib::Source is abstract, and Glib::IOSource has no // constructor that takes a GSource* //#m4 _CONVERSION(`GSource*',`Glib::RefPtr<Glib::Source>',`Glib::RefPtr<Glib::Source>(new ::Glib::Source($3))') //_WRAP_METHOD(Glib::RefPtr<Glib::Source> create_source(Glib::IOCondition condition, const Glib::RefPtr<Cancellable>& cancellable), g_socket_create_source) _WRAP_METHOD(Glib::IOCondition condition_check(Glib::IOCondition condition), g_socket_condition_check) - // TODO: non-cancellable version + _WRAP_METHOD(void condition_wait(Glib::IOCondition condition, const Glib::RefPtr<Cancellable>& cancellable), g_socket_condition_wait, errthrow) +#ifdef GLIBMM_EXCEPTIONS_ENABLED + void condition_wait(Glib::IOCondition condition); +#else + void condition_wait(Glib::IOCondition condition, std::auto_ptr<Glib::Error>& error); +#endif //GLIBMM_EXCEPTIONS_ENABLED + _WRAP_METHOD(void set_listen_backlog(int backlog), g_socket_set_listen_backlog) _WRAP_METHOD(int get_listen_backlog() const, g_socket_get_listen_backlog) _WRAP_METHOD(void set_blocking(bool blocking), g_socket_set_blocking) |