From cb07728aed463aff15be0dcbdd52951c5cd154ac Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Mon, 5 Jun 2006 17:32:14 +0000 Subject: When using --enable-api-exception=no, only try to get the Glib::Error when 2006-06-05 Murray Cumming * glib/src/convert.ccg: When using --enable-api-exception=no, only try to get the Glib::Error when the GError is not null. --- ChangeLog | 5 +++++ glib/src/convert.ccg | 24 ++++++++++++------------ 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index f24ef1a0..68c8a45e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2006-06-05 Murray Cumming + + * glib/src/convert.ccg: When using --enable-api-exception=no, only try to get the Glib::Error + when the GError is not null. + 2006-05-18 Murray Cumming * tools/m4/method.m4: _METHOD(): When using errthrow, actually print the function call even if diff --git a/glib/src/convert.ccg b/glib/src/convert.ccg index 9a4dae14..5ea705a3 100644 --- a/glib/src/convert.ccg +++ b/glib/src/convert.ccg @@ -94,7 +94,7 @@ std::string IConv::convert(const std::string& str, std::auto_ptr& e #ifdef GLIBMM_EXCEPTIONS_ENABLED if(gerror) ::Glib::Error::throw_exception(gerror); #else - error = ::Glib::Error::throw_exception(gerror); + if(gerror) error = ::Glib::Error::throw_exception(gerror); #endif //GLIBMM_EXCEPTIONS_ENABLED return std::string(ScopedPtr(buf).get(), bytes_written); @@ -138,7 +138,7 @@ std::string convert(const std::string& str, #ifdef GLIBMM_EXCEPTIONS_ENABLED if(gerror) ::Glib::Error::throw_exception(gerror); #else - error = ::Glib::Error::throw_exception(gerror); + if(gerror) error = ::Glib::Error::throw_exception(gerror); #endif //GLIBMM_EXCEPTIONS_ENABLED return std::string(ScopedPtr(buf).get(), bytes_written); @@ -165,7 +165,7 @@ std::string convert_with_fallback(const std::string& str, #ifdef GLIBMM_EXCEPTIONS_ENABLED if(gerror) ::Glib::Error::throw_exception(gerror); #else - error = ::Glib::Error::throw_exception(gerror); + if(gerror) error = ::Glib::Error::throw_exception(gerror); #endif //GLIBMM_EXCEPTIONS_ENABLED return std::string(ScopedPtr(buf).get(), bytes_written); @@ -194,7 +194,7 @@ std::string convert_with_fallback(const std::string& str, #ifdef GLIBMM_EXCEPTIONS_ENABLED if(gerror) ::Glib::Error::throw_exception(gerror); #else - error = ::Glib::Error::throw_exception(gerror); + if(gerror) error = ::Glib::Error::throw_exception(gerror); #endif //GLIBMM_EXCEPTIONS_ENABLED return std::string(ScopedPtr(buf).get(), bytes_written); @@ -216,7 +216,7 @@ Glib::ustring locale_to_utf8(const std::string& opsys_string, std::auto_ptr scoped_buf (buf); @@ -239,7 +239,7 @@ std::string locale_from_utf8(const Glib::ustring& utf8_string, std::auto_ptr(buf).get(), bytes_written); @@ -261,7 +261,7 @@ Glib::ustring filename_to_utf8(const std::string& opsys_string, std::auto_ptr scoped_buf (buf); @@ -284,7 +284,7 @@ std::string filename_from_utf8(const Glib::ustring& utf8_string, std::auto_ptr(buf).get(), bytes_written); @@ -305,7 +305,7 @@ std::string filename_from_uri(const Glib::ustring& uri, Glib::ustring& hostname, #ifdef GLIBMM_EXCEPTIONS_ENABLED if(gerror) ::Glib::Error::throw_exception(gerror); #else - error = ::Glib::Error::throw_exception(gerror); + if(gerror) error = ::Glib::Error::throw_exception(gerror); #endif //GLIBMM_EXCEPTIONS_ENABLED // Let's take ownership at this point. @@ -332,7 +332,7 @@ std::string filename_from_uri(const Glib::ustring& uri, std::auto_ptr(buf).get()); @@ -351,7 +351,7 @@ Glib::ustring filename_to_uri(const std::string& filename, const Glib::ustring& #ifdef GLIBMM_EXCEPTIONS_ENABLED if(gerror) ::Glib::Error::throw_exception(gerror); #else - error = ::Glib::Error::throw_exception(gerror); + if(gerror) error = ::Glib::Error::throw_exception(gerror); #endif //GLIBMM_EXCEPTIONS_ENABLED return Glib::ustring(ScopedPtr(buf).get()); @@ -370,7 +370,7 @@ Glib::ustring filename_to_uri(const std::string& filename, std::auto_ptr(buf).get()); -- cgit v1.2.1