[libgda] Use g_set_error_literal() only if glib >= 2.18



commit 300d432e0b58a278d3efc4b3d1e3c5865622fcdd
Author: Vivien Malerba <malerba gnome-db org>
Date:   Tue Sep 15 20:33:11 2009 +0200

    Use g_set_error_literal() only if glib >= 2.18

 libgda-ui/data-entries/plugins/common-pict.c |    4 ++++
 providers/mysql/gda-mysql-provider.c         |    4 ++++
 2 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/libgda-ui/data-entries/plugins/common-pict.c b/libgda-ui/data-entries/plugins/common-pict.c
index 5d8eb4a..85afcc5 100644
--- a/libgda-ui/data-entries/plugins/common-pict.c
+++ b/libgda-ui/data-entries/plugins/common-pict.c
@@ -264,7 +264,11 @@ common_pict_make_pixbuf (PictOptions *options, PictBinData *bindata, PictAllocat
 							      loc_error && loc_error->message ? loc_error->message : _("No detail"));
 				g_error_free (loc_error);
 				*stock = GTK_STOCK_DIALOG_WARNING;
+#if GLIB_MAJOR_VERSION == 2 && GLIB_MINOR_VERSION < 18
+				g_set_error (error, 0, 0, "%s", notice_msg);
+#else
 				g_set_error_literal (error, 0, 0, notice_msg);
+#endif
 				g_free (notice_msg);
 			}
 			
diff --git a/providers/mysql/gda-mysql-provider.c b/providers/mysql/gda-mysql-provider.c
index d7e7ba0..882d6dd 100644
--- a/providers/mysql/gda-mysql-provider.c
+++ b/providers/mysql/gda-mysql-provider.c
@@ -497,7 +497,11 @@ real_open_connection (const gchar  *host,
 						  (port > 0) ? port : 0,
 						  socket, flags);
 	if (!return_mysql || mysql != return_mysql) {
+#if GLIB_MAJOR_VERSION == 2 && GLIB_MINOR_VERSION < 18
+		g_set_error (error, 0, 0, "%s", mysql_error (mysql));
+#else
 		g_set_error_literal (error, 0, 0, mysql_error (mysql));
+#endif
 		g_free (mysql);
 		mysql = NULL;
 	}



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