[libgdamm] Fixed build problems on maemo due to --fno-exceptions and



commit 51d4e05486f796bab0702b5984a9658a0eacb1e1
Author: Johannes Schmid <jhs gnome org>
Date:   Mon Jun 22 21:11:58 2009 +0200

    Fixed build problems on maemo due to --fno-exceptions and
    GLIBMM_EXCEPTIONS_ENABLED# Please enter the commit message for your changes.

 ChangeLog                 |   11 +++++++++++
 configure.in              |    2 +-
 libgda/src/connection.ccg |   16 ++++++++--------
 libgda/src/connection.hg  |    4 ++--
 libgda/src/holder.hg      |   15 ++++++++++++++-
 libgda/src/metastore.ccg  |    6 +++---
 libgda/src/set.ccg        |    8 ++++++++
 libgda/src/set.hg         |    5 ++++-
 8 files changed, 51 insertions(+), 16 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index dded8e2..2d4df6f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2009-06-22  Johannes Schmid  <jschmid openismus com>
+	
+	* libgda/src/connection.ccg:
+	* libgda/src/connection.hg:
+	* libgda/src/holder.hg:
+	* libgda/src/metastore.ccg:
+	* libgda/src/set.hg:
+	* libgda/src/set.ccg:
+	Fixed builds problems on maemo due to --fno-exceptions and
+	GLIBMM_EXCEPTIONS_ENABLED
+
 2009-06-02  Armin Burgmeier  <armin openismus com>
 
 	* libgda/src/connection.hg: Improved the documentation for the
diff --git a/configure.in b/configure.in
index 8f8f87c..1a39d9b 100644
--- a/configure.in
+++ b/configure.in
@@ -47,7 +47,7 @@ PACKAGE=libgdamm
 dnl Initialize automake stuff
 # Initialize automake stuff
 # tar-ustar asks it to use a sensible tar format that can handle long filenames.
-AM_INIT_AUTOMAKE([1.9 tar-ustar])
+AM_INIT_AUTOMAKE([1.8])
 
 dnl Specify a configuration file (no autoheader)
 AM_CONFIG_HEADER(libgda/libgdammconfig.h)
diff --git a/libgda/src/connection.ccg b/libgda/src/connection.ccg
index 5200366..1bf50a6 100644
--- a/libgda/src/connection.ccg
+++ b/libgda/src/connection.ccg
@@ -141,7 +141,7 @@ Glib::RefPtr<Glib::Object> Connection::statement_execute(const Glib::ustring& sq
     stmt = parser->parse_string(sql);
 #else
     stmt = parser->parse_string(sql, error);
-    if(error)
+    if(error.get())
       return Glib::RefPtr<Glib::Object>();
 #endif
   }
@@ -253,7 +253,7 @@ Glib::ustring Connection::statement_to_sql(const Glib::RefPtr<Statement>& statem
 #ifdef GLIBMM_EXCEPTIONS_ENABLED
 Glib::RefPtr<DataModel> Connection::statement_execute_select(const Glib::RefPtr<Statement>& stmt, StatementModelUsage model_usage)
 #else
-Glib::RefPtr<DataModel> Connection::statement_execute_select(const Glib::RefPtr<Statement>& stmt, StatementModelUsage model_usage. std::auto_ptr<Glib::Error>& error)
+Glib::RefPtr<DataModel> Connection::statement_execute_select(const Glib::RefPtr<Statement>& stmt, StatementModelUsage model_usage, std::auto_ptr<Glib::Error>& error)
 #endif
 {
   GError* gerror = 0;
@@ -283,7 +283,7 @@ Glib::RefPtr<DataModel> Connection::statement_execute_select(const Glib::ustring
     stmt = parser->parse_string(sql);
 #else
     stmt = parser->parse_string(sql, error);
-    if(error
+    if(error.get())
       return Glib::RefPtr<DataModel>();
 #endif
   }
@@ -308,7 +308,7 @@ Glib::RefPtr<DataModel> Connection::statement_execute_select(const Glib::ustring
 #ifdef GLIBMM_EXCEPTIONS_ENABLED
 bool Connection::update_meta_store()
 #else
-bool Connection::update_meta_store(std::auto_ptr<Glib::Error>& err)
+bool Connection::update_meta_store(std::auto_ptr<Glib::Error>& error)
 #endif
 {
   GError* gerror = 0;
@@ -327,7 +327,7 @@ bool Connection::update_meta_store(std::auto_ptr<Glib::Error>& err)
 #ifdef GLIBMM_EXCEPTIONS_ENABLED
 bool Connection::update_meta_store(const Glib::ustring& id)
 #else
-bool Connection::update_meta_store(const Glib::ustring& id, std::auto_ptr<Glib::Error>& err)
+bool Connection::update_meta_store(const Glib::ustring& id, std::auto_ptr<Glib::Error>& error)
 #endif
 {
   GError* gerror = 0;
@@ -366,7 +366,7 @@ Glib::RefPtr<DataModel> Connection::get_meta_store_data(ConnectionMetaType meta_
 #ifdef GLIBMM_EXCEPTIONS_ENABLED
 bool Connection::update_meta_store_table(const Glib::ustring& table_name, const Glib::ustring& schema_name)
 #else
-bool Connection::update_meta_store_table(const Glib::ustring& table_name, const Glib::ustring& schema_name, std::auto_ptr<Glib::Error>& err)
+bool Connection::update_meta_store_table(const Glib::ustring& table_name, const Glib::ustring& schema_name, std::auto_ptr<Glib::Error>& error)
 #endif
 {
   GValue table_name_value = { 0 };
@@ -401,7 +401,7 @@ bool Connection::update_meta_store_table(const Glib::ustring& table_name, const
 #ifdef GLIBMM_EXCEPTIONS_ENABLED
 bool Connection::update_meta_store_table_names(const Glib::ustring& schema_name)
 #else
-bool Connection::update_meta_store_table_names(const Glib::ustring& schema_name, std::auto_ptr<Glib::Error>& err)
+bool Connection::update_meta_store_table_names(const Glib::ustring& schema_name, std::auto_ptr<Glib::Error>& error)
 #endif
 {
   GValue table_schema_value = { 0 };
@@ -431,7 +431,7 @@ bool Connection::update_meta_store_table_names(const Glib::ustring& schema_name,
 #ifdef GLIBMM_EXCEPTIONS_ENABLED
 bool Connection::update_meta_store_data_types()
 #else
-bool Connection::update_meta_store_data_types(std::auto_ptr<Glib::Error>& err)
+bool Connection::update_meta_store_data_types(std::auto_ptr<Glib::Error>& error)
 #endif
 {
   GdaMetaContext mcontext = {(gchar*)"_builtin_data_types", 0, 0, 0 };
diff --git a/libgda/src/connection.hg b/libgda/src/connection.hg
index 3b3c098..b902342 100644
--- a/libgda/src/connection.hg
+++ b/libgda/src/connection.hg
@@ -143,7 +143,7 @@ public:
   Glib::RefPtr<DataModel> statement_execute_select(const Glib::ustring& sql, StatementModelUsage model_usage = STATEMENT_MODEL_RANDOM_ACCESS);
 #else
   Glib::RefPtr<DataModel> statement_execute_select(const Glib::RefPtr<Statement>& stmt, StatementModelUsage model_usage, std::auto_ptr<Glib::Error>& error);
-  Glib::RefPtr<DataModel> statement_execute_select(const Glib::ustring& sql, std::auto_ptr<Glib::Error>& error);
+  Glib::RefPtr<DataModel> statement_execute_select(const Glib::ustring& sql, StatementModelUsage model_usage, std::auto_ptr<Glib::Error>& error);
 #endif
 
   #m4 _CONVERSION(`const Glib::ArrayHandle<GType>&', `GType*', `const_cast<GType*>(($3).data())')
@@ -293,7 +293,7 @@ public:
   #ifdef GLIBMM_EXCEPTIONS_ENABLED
   Glib::RefPtr<DataModel> get_meta_store_data(ConnectionMetaType meta_type);
   #else
-  Glib::RefPtr<DataModel> Connection::get_meta_store_data(ConnectionMetaType meta_type, std::auto_ptr<Glib::Error>& error);
+  Glib::RefPtr<DataModel> get_meta_store_data(ConnectionMetaType meta_type, std::auto_ptr<Glib::Error>& error);
   #endif //GLIBMM_EXCEPTIONS_ENABLED
 
   _WRAP_METHOD(Glib::RefPtr<MetaStore> get_meta_store(), gda_connection_get_meta_store, refreturn)
diff --git a/libgda/src/holder.hg b/libgda/src/holder.hg
index acc8354..6717045 100644
--- a/libgda/src/holder.hg
+++ b/libgda/src/holder.hg
@@ -62,9 +62,13 @@ public:
   _WRAP_METHOD(bool set_value_as_value(const Value& value), gda_holder_set_value, errthrow)
 
   //TODO: Documentation:
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
   template <class ValueType>
   bool set_value(const ValueType& value);
-
+#else
+  template <class ValueType>
+  bool set_value(const ValueType& value, std::auto_ptr<Glib::Error>& error);
+#endif
 
   _WRAP_METHOD(bool set_value_str(const Glib::RefPtr<DataHandler>& dh, const Glib::ustring& value), gda_holder_set_value_str, errthrow)
   _WRAP_METHOD(bool take_value(const Value& value), gda_holder_take_value, errthrow)
@@ -119,12 +123,21 @@ public:
 };
 
 #ifndef DOXYGEN_SHOULD_SKIP_THIS
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
 template <class ValueType> inline
 bool Holder::set_value(const ValueType& value)
 {
   Gnome::Gda::Value gdavalue(value);
   return this->set_value_as_value(gdavalue);
 }
+#else
+template <class ValueType> inline
+bool Holder::set_value(const ValueType& value, std::auto_ptr<Glib::Error>& error)
+{
+  Gnome::Gda::Value gdavalue(value);
+  return this->set_value_as_value(gdavalue, error);
+}
+#endif
 #endif //DOXYGEN_SHOULD_SKIP_THIS
 
 } // namespace Gda
diff --git a/libgda/src/metastore.ccg b/libgda/src/metastore.ccg
index 5d9c50e..8ed517e 100644
--- a/libgda/src/metastore.ccg
+++ b/libgda/src/metastore.ccg
@@ -30,7 +30,7 @@ namespace Gda
 #ifdef GLIBMM_EXCEPTIONS_ENABLED
 Glib::RefPtr<DataModel> MetaStore::extract(const Glib::ustring& sql)
 #else
-Glib::RefPtr<DataModel> MetaStore::extract(const Glib::ustring& sql, std::auto_ptr<Glib::Error>& err)
+Glib::RefPtr<DataModel> MetaStore::extract(const Glib::ustring& sql, std::auto_ptr<Glib::Error>& error)
 #endif
 {
   GError* gerror = 0;
@@ -49,7 +49,7 @@ Glib::RefPtr<DataModel> MetaStore::extract(const Glib::ustring& sql, std::auto_p
 #ifdef GLIBMM_EXCEPTIONS_ENABLED
 bool MetaStore::modify(const Glib::ustring& sql, const Glib::RefPtr<DataModel>& data_model, const Glib::ustring& condition)
 #else
-bool MetaStore::modify(const Glib::ustring& sql, const Glib::RefPtr<DataModel>& data_model, const Glib::ustring& condition, std::auto_ptr<Glib::Error>& err)
+bool MetaStore::modify(const Glib::ustring& sql, const Glib::RefPtr<DataModel>& data_model, const Glib::ustring& condition, std::auto_ptr<Glib::Error>& error)
 #endif
 {
   GError* gerror = 0;
@@ -68,7 +68,7 @@ bool MetaStore::modify(const Glib::ustring& sql, const Glib::RefPtr<DataModel>&
 #ifdef GLIBMM_EXCEPTIONS_ENABLED
 bool MetaStore::get_attribute_value(const Glib::ustring& att_name, Glib::ustring& att_value)
 #else
-bool MetaStore::get_attribute_value(const Glib::ustring& att_name, Glib::ustring& att_value, std::auto_ptr<Glib::Error>)
+bool MetaStore::get_attribute_value(const Glib::ustring& att_name, Glib::ustring& att_value, std::auto_ptr<Glib::Error> error)
 #endif
 {
   GError* gerror = 0;
diff --git a/libgda/src/set.ccg b/libgda/src/set.ccg
index 3849314..d59da7e 100644
--- a/libgda/src/set.ccg
+++ b/libgda/src/set.ccg
@@ -35,10 +35,18 @@ bool Set::set_holder_value(const Glib::ustring& id, T value)
   return gda_set_set_holder_value (gobj(), id.c_str(), value);
 }
 
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
 void Set::add_holder_as_value(const Glib::ustring& id, const Gda::Value& value)
+#else
+void Set::add_holder_as_value(const Glib::ustring& id, const Gda::Value& value, std::auto_ptr<Glib::Error>& error)
+#endif
 {
   Glib::RefPtr<Holder> holder = Holder::create(value.get_value_type(), id);
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
   holder->set_value(value);
+#else
+  holder->set_value(value, error);
+#endif
   add_holder(holder);
 }
 
diff --git a/libgda/src/set.hg b/libgda/src/set.hg
index be9d445..5b862b3 100644
--- a/libgda/src/set.hg
+++ b/libgda/src/set.hg
@@ -74,8 +74,11 @@ public:
    * @param id Name of the holder
    * @param value Value of the holder
    */
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
   void add_holder_as_value(const Glib::ustring& id, const Gda::Value& value);
-
+#else
+  void add_holder_as_value(const Glib::ustring& id, const Gda::Value& value, std::auto_ptr<Glib::Error>& error);
+#endif
   /** Add a holder
    * 
    * Convenience method to add a holder with value



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]