[glibmm] Make build successful when exceptions, vfuncs, etc. are disabled.
- From: José Alburquerque <jaalburqu src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [glibmm] Make build successful when exceptions, vfuncs, etc. are disabled.
- Date: Fri, 4 Dec 2009 05:52:15 +0000 (UTC)
commit fc53d8da97fc762bb60bff4f08f40fe1ba3712b8
Author: José Alburquerque <jaalburqu svn gnome org>
Date: Fri Dec 4 00:45:54 2009 -0500
Make build successful when exceptions, vfuncs, etc. are disabled.
* gio/src/iostream.hg (close): Include a definition for when
exceptions are disabled.
* glib/src/keyfile.ccg: Correct some typos related to exceptions
disabled.
* gio/src/socket.ccg:
* gio/src/socket.hg: Included definitions and code for when
exceptions are disabled.
* gio/src/resolver.ccg (hostname_to_ascii):
(hostname_to_unicode): Included returns to avoid warnings.
ChangeLog | 14 ++++++++++++++
gio/src/iostream.hg | 8 +++++++-
gio/src/resolver.ccg | 4 ++--
gio/src/socket.ccg | 38 ++++++++++++++++++++++++++++++++++++++
gio/src/socket.hg | 30 ++++++++++++++++++++++++++++++
glib/src/keyfile.ccg | 10 +++++-----
6 files changed, 96 insertions(+), 8 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 8ad24ec..9e26a04 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2009-12-03 José Alburquerque <jaalburqu svn gnome org>
+
+ Make build successful when exceptions, vfuncs, etc. are disabled.
+
+ * gio/src/iostream.hg (close): Include a definition for when
+ exceptions are disabled.
+ * glib/src/keyfile.ccg: Correct some typos related to exceptions
+ disabled.
+ * gio/src/socket.ccg:
+ * gio/src/socket.hg: Included definitions and code for when
+ exceptions are disabled.
+ * gio/src/resolver.ccg (hostname_to_ascii):
+ (hostname_to_unicode): Included returns to avoid warnings.
+
2009-10-23 Jonathon Jongsma <jonathon jongsma collabora co uk>
Re-enable Network IO stuff (Socket, Resolver, etc)
diff --git a/gio/src/iostream.hg b/gio/src/iostream.hg
index eda4a8f..2a7a97d 100644
--- a/gio/src/iostream.hg
+++ b/gio/src/iostream.hg
@@ -44,7 +44,13 @@ public:
_WRAP_METHOD(Glib::RefPtr<InputStream> get_input_stream(), g_io_stream_get_input_stream)
_WRAP_METHOD(Glib::RefPtr<OutputStream> get_output_stream(), g_io_stream_get_output_stream)
_WRAP_METHOD(bool close(const Glib::RefPtr<Cancellable>& cancellable), g_io_stream_close, errthrow)
- bool close();
+
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+bool close();
+#else
+bool close(std::auto_ptr<Glib::Error>& error);
+#endif //GLIBMM_EXCEPTIONS_ENABLED
+
void close_async(const SlotAsyncReady&slot, const Glib::RefPtr<Cancellable>& cancellable, int io_priority=Glib::PRIORITY_DEFAULT);
void close_async(const SlotAsyncReady& slot, int io_priority = Glib::PRIORITY_DEFAULT);
_IGNORE(g_io_stream_close_async)
diff --git a/gio/src/resolver.ccg b/gio/src/resolver.ccg
index 1ddc037..5f8996d 100644
--- a/gio/src/resolver.ccg
+++ b/gio/src/resolver.ccg
@@ -185,14 +185,14 @@ Resolver::lookup_service_async(const Glib::ustring& service,
std::string
hostname_to_ascii (const Glib::ustring& hostname)
{
- Glib::convert_return_gchar_ptr_to_stdstring
+ return Glib::convert_return_gchar_ptr_to_stdstring
(g_hostname_to_ascii (hostname.c_str ()));
}
Glib::ustring
hostname_to_unicode (const Glib::ustring& hostname)
{
- Glib::convert_return_gchar_ptr_to_ustring
+ return Glib::convert_return_gchar_ptr_to_ustring
(g_hostname_to_unicode (hostname.c_str ()));
}
diff --git a/gio/src/socket.ccg b/gio/src/socket.ccg
index 2a95002..f0724b0 100644
--- a/gio/src/socket.ccg
+++ b/gio/src/socket.ccg
@@ -24,32 +24,70 @@
namespace Gio
{
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+Socket::Socket(SocketFamily family, SocketType type, SocketProtocol protocol,
+ const Glib::RefPtr<Cancellable>& cancellable)
+#else
Socket::Socket(SocketFamily family, SocketType type, SocketProtocol protocol,
+ std::auto_ptr<Glib::Error>& error,
const Glib::RefPtr<Cancellable>& cancellable)
+#endif //GLIBMM_EXCEPTIONS_ENABLED
:
_CONSTRUCT("family", int(family), "type", int(type), "protocol", int(protocol))
{
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
init(cancellable);
+#else
+ init(cancellable, error);
+#endif //GLIBMM_EXCEPTIONS_ENABLED
}
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
Socket::Socket(int fd, const Glib::RefPtr<Cancellable>& cancellable)
+#else
+Socket::Socket(int fd, std::auto_ptr<Glib::Error>& error,
+ const Glib::RefPtr<Cancellable>& cancellable)
+#endif //GLIBMM_EXCEPTIONS_ENABLED
:
_CONSTRUCT("fd", fd)
{
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
init(cancellable);
+#else
+ init(cancellable, error);
+#endif //GLIBMM_EXCEPTIONS_ENABLED
}
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
// static
Glib::RefPtr<Socket> Socket::create(SocketFamily family, SocketType type, SocketProtocol protocol,
const Glib::RefPtr<Cancellable>& cancellable)
+#else
+Glib::RefPtr<Socket> Socket::create(SocketFamily family, SocketType type, SocketProtocol protocol,
+ std::auto_ptr<Glib::Error>& error,
+ const Glib::RefPtr<Cancellable>& cancellable)
+#endif //GLIBMM_EXCEPTIONS_ENABLED
{
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
return Glib::RefPtr<Socket>(new Socket(family, type, protocol, cancellable));
+#else
+ return Glib::RefPtr<Socket>(new Socket(family, type, protocol, error, cancellable));
+#endif //GLIBMM_EXCEPTIONS_ENABLED
}
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
// static
Glib::RefPtr<Socket> Socket::create_from_fd(int fd, const Glib::RefPtr<Cancellable>& cancellable)
+#else
+Glib::RefPtr<Socket> Socket::create_from_fd(int fd, std::auto_ptr<Glib::Error>& error,
+ const Glib::RefPtr<Cancellable>& cancellable)
+#endif //GLIBMM_EXCEPTIONS_ENABLED
{
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
return Glib::RefPtr<Socket>(new Socket(fd, cancellable));
+#else
+ return Glib::RefPtr<Socket>(new Socket(fd, error, cancellable));
+#endif //GLIBMM_EXCEPTIONS_ENABLED
}
diff --git a/gio/src/socket.hg b/gio/src/socket.hg
index c81b8e9..80ac5ea 100644
--- a/gio/src/socket.hg
+++ b/gio/src/socket.hg
@@ -93,18 +93,48 @@ class Socket : public Glib::Object, public Initable
_IMPLEMENTS_INTERFACE(Initable)
protected:
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+ Socket(SocketFamily family, SocketType type, SocketProtocol protocol,
+ const Glib::RefPtr<Cancellable>& cancellable);
+#else
Socket(SocketFamily family, SocketType type, SocketProtocol protocol,
+ std::auto_ptr<Glib::Error>& error,
const Glib::RefPtr<Cancellable>& cancellable);
+#endif //GLIBMM_EXCEPTIONS_ENABLED
+
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
Socket(int fd, const Glib::RefPtr<Cancellable>& cancellable);
+#else
+ Socket(int fd, std::auto_ptr<Glib::Error>& error,
+ const Glib::RefPtr<Cancellable>& cancellable);
+#endif //GLIBMM_EXCEPTIONS_ENABLED
public:
_WRAP_METHOD_DOCS_ONLY(g_socket_new)
+ /** @throw Glib::Error
+ */
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
static Glib::RefPtr<Socket>
create(SocketFamily family, SocketType type, SocketProtocol protocol,
const Glib::RefPtr<Cancellable>& cancellable = Glib::RefPtr<Cancellable>());
+#else
+ static Glib::RefPtr<Socket>
+ create(SocketFamily family, SocketType type, SocketProtocol protocol,
+ std::auto_ptr<Glib::Error>& error,
+ const Glib::RefPtr<Cancellable>& cancellable = Glib::RefPtr<Cancellable>());
+#endif //GLIBMM_EXCEPTIONS_ENABLED
+
_WRAP_METHOD_DOCS_ONLY(g_socket_new_from_fd)
+ /** @throw Glib::Error
+ */
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
static Glib::RefPtr<Socket> create_from_fd(int fd, const Glib::RefPtr<Cancellable>&
cancellable = Glib::RefPtr<Cancellable>());
+#else
+ static Glib::RefPtr<Socket> create_from_fd(int fd, std::auto_ptr<Glib::Error>& error,
+ const Glib::RefPtr<Cancellable>&
+ cancellable = Glib::RefPtr<Cancellable>());
+#endif //GLIBMM_EXCEPTIONS_ENABLED
_WRAP_METHOD(void bind(const Glib::RefPtr<SocketAddress>& address, bool allow_reuse), g_socket_bind, errthrow)
_WRAP_METHOD(void listen(), g_socket_listen, errthrow)
diff --git a/glib/src/keyfile.ccg b/glib/src/keyfile.ccg
index db4a6c5..9c24a61 100644
--- a/glib/src/keyfile.ccg
+++ b/glib/src/keyfile.ccg
@@ -41,7 +41,7 @@ KeyFile::~KeyFile()
#ifdef GLIBMM_EXCEPTIONS_ENABLED
bool KeyFile::load_from_data(const Glib::ustring& data, KeyFileFlags flags)
#else
-bool KeyFile::load_from_data(const Glib::ustring& data, KeyFileFlags flags, std:auto_ptr<Glib::Error>& error)
+bool KeyFile::load_from_data(const Glib::ustring& data, KeyFileFlags flags, std::auto_ptr<Glib::Error>& error)
#endif
{
GError* gerror = 0;
@@ -64,7 +64,7 @@ bool KeyFile::load_from_data(const Glib::ustring& data, KeyFileFlags flags, std:
#ifdef GLIBMM_EXCEPTIONS_ENABLED
bool KeyFile::load_from_data_dirs(const std::string& file, std::string& full_path, KeyFileFlags flags)
#else
-bool KeyFile::load_from_data_dirs(const std::string& file, std::string& full_path, KeyFileFlags flags, std:auto_ptr<Glib::Error>& error)
+bool KeyFile::load_from_data_dirs(const std::string& file, std::string& full_path, KeyFileFlags flags, std::auto_ptr<Glib::Error>& error)
#endif
{
GError* gerror = 0;
@@ -93,7 +93,7 @@ bool KeyFile::load_from_data_dirs(const std::string& file, std::string& full_pat
#ifdef GLIBMM_EXCEPTIONS_ENABLED
Glib::ustring KeyFile::to_data()
#else
-Glib::ustring KeyFile::to_data(std:auto_ptr<Glib::Error>& error)
+Glib::ustring KeyFile::to_data(std::auto_ptr<Glib::Error>& error)
#endif
{
GError* gerror = 0;
@@ -120,7 +120,7 @@ Glib::ArrayHandle<Glib::ustring> KeyFile::get_groups() const
#ifdef GLIBMM_EXCEPTIONS_ENABLED
Glib::ArrayHandle<Glib::ustring> KeyFile::get_keys(const Glib::ustring& group_name) const
#else
-Glib::ArrayHandle<Glib::ustring> KeyFile::get_keys(const Glib::ustring& group_name, std:auto_ptr<Glib::Error>& error) const
+Glib::ArrayHandle<Glib::ustring> KeyFile::get_keys(const Glib::ustring& group_name, std::auto_ptr<Glib::Error>& error) const
#endif
{
gsize length = 0;
@@ -146,7 +146,7 @@ Glib::ustring KeyFile::get_locale_string(const Glib::ustring& group_name,
const Glib::ustring& key) const
#else
Glib::ustring KeyFile::get_locale_string(const Glib::ustring& group_name,
- const Glib::ustring& key, std:auto_ptr<Glib::Error>& error) const
+ const Glib::ustring& key, std::auto_ptr<Glib::Error>& error) const
#endif
{
GError* gerror = 0;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]