Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/eglib
diff options
context:
space:
mode:
authorZoltan Varga <vargaz@gmail.com>2010-03-04 04:16:22 +0300
committerZoltan Varga <vargaz@gmail.com>2010-03-04 04:16:22 +0300
commita2cfac89b5cf50509e55a48ed0de850cda296b7a (patch)
tree038ada8bfd8af685e78f3ed7edd77618319961ea /eglib
parent83f38295736cf02942d48e8bc008c662186f3abd (diff)
2010-03-04 Zoltan Varga <vargaz@gmail.com>
* test/test.c: Fix the build. * src/glib.h src/goutput.c: Emit asserts through a g_assertion_message () function which is decorated with G_GNUC_NORETURN, to fix many warnings when using the eglib build. svn path=/trunk/mono/; revision=152983
Diffstat (limited to 'eglib')
-rw-r--r--eglib/ChangeLog7
-rw-r--r--eglib/src/glib.h6
-rw-r--r--eglib/src/goutput.c10
-rw-r--r--eglib/test/test.c2
4 files changed, 23 insertions, 2 deletions
diff --git a/eglib/ChangeLog b/eglib/ChangeLog
index bfe0f46a44f..785b4315605 100644
--- a/eglib/ChangeLog
+++ b/eglib/ChangeLog
@@ -1,3 +1,10 @@
+2010-03-04 Zoltan Varga <vargaz@gmail.com>
+
+ * test/test.c: Fix the build.
+
+ * src/glib.h src/goutput.c: Emit asserts through a g_assertion_message ()
+ function which is decorated with G_GNUC_NORETURN, to fix many warnings when using
+ the eglib build.
Mon Mar 1 17:12:24 CET 2010 Paolo Molaro <lupus@ximian.com>
diff --git a/eglib/src/glib.h b/eglib/src/glib.h
index 5a2fe2484de..75e7dc90818 100644
--- a/eglib/src/glib.h
+++ b/eglib/src/glib.h
@@ -204,8 +204,8 @@ guint g_int_hash (gconstpointer v1);
gboolean g_str_equal (gconstpointer v1, gconstpointer v2);
guint g_str_hash (gconstpointer v1);
-#define g_assert(x) G_STMT_START { if (!(x)) g_error ("* Assertion at %s:%d, condition `%s' not met\n", __FILE__, __LINE__, #x); } G_STMT_END
-#define g_assert_not_reached() G_STMT_START { g_error ("* Assertion: should not be reached at %s:%d\n", __FILE__, __LINE__); } G_STMT_END
+#define g_assert(x) G_STMT_START { if (!(x)) g_assertion_message ("* Assertion at %s:%d, condition `%s' not met\n", __FILE__, __LINE__, #x); } G_STMT_END
+#define g_assert_not_reached() G_STMT_START { g_assertion_message ("* Assertion: should not be reached at %s:%d\n", __FILE__, __LINE__); } G_STMT_END
/*
* Errors
@@ -511,6 +511,7 @@ GLogLevelFlags g_log_set_always_fatal (GLogLevelFlags fatal_mask);
GLogLevelFlags g_log_set_fatal_mask (const gchar *log_domain, GLogLevelFlags fatal_mask);
void g_logv (const gchar *log_domain, GLogLevelFlags log_level, const gchar *format, va_list args);
void g_log (const gchar *log_domain, GLogLevelFlags log_level, const gchar *format, ...);
+void g_assertion_message (const gchar *format, ...) G_GNUC_NORETURN;
#ifdef HAVE_C99_SUPPORT
#define g_error(format, ...) g_log (G_LOG_DOMAIN, G_LOG_LEVEL_ERROR, format, __VA_ARGS__)
@@ -530,6 +531,7 @@ void g_log (const gchar *log_domain, GLogLevelFlags l
#define g_printerr(...) fprintf (stderr, __VA_ARGS__)
#endif
#define g_log_set_handler(a,b,c,d)
+
/*
* Conversions
*/
diff --git a/eglib/src/goutput.c b/eglib/src/goutput.c
index cd2f87f3e51..3a12201735e 100644
--- a/eglib/src/goutput.c
+++ b/eglib/src/goutput.c
@@ -90,3 +90,13 @@ g_log (const gchar *log_domain, GLogLevelFlags log_level, const gchar *format, .
va_end (args);
}
+void
+g_assertion_message (const gchar *format, ...)
+{
+ va_list args;
+
+ va_start (args, format);
+ g_logv (G_LOG_DOMAIN, G_LOG_LEVEL_ERROR, format, args);
+ va_end (args);
+}
+
diff --git a/eglib/test/test.c b/eglib/test/test.c
index dc97450ec56..602c2714132 100644
--- a/eglib/test/test.c
+++ b/eglib/test/test.c
@@ -26,6 +26,8 @@
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
+#define _GNU_SOURCE
+
#include <config.h>
#include <stdlib.h>
#include <stdio.h>