[vte] Add static assertions
- From: Behdad Esfahbod <behdad src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [vte] Add static assertions
- Date: Sun, 6 Sep 2009 04:13:16 +0000 (UTC)
commit e36788647962b2632e8f241b830e2bb18f173889
Author: Behdad Esfahbod <behdad behdad org>
Date: Sat Sep 5 23:32:58 2009 -0400
Add static assertions
src/debug.h | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/src/debug.h b/src/debug.h
index 77f8dce..b9d23c6 100644
--- a/src/debug.h
+++ b/src/debug.h
@@ -86,6 +86,10 @@ static void _vte_debug_print(guint flags, const char *fmt, ...)
}
#endif
+#define _ASSERT_STATIC1(_line, _cond) typedef int _static_assert_on_line_##_line##_failed[(_cond)?1:-1]
+#define _ASSERT_STATIC0(_line, _cond) _ASSERT_STATIC1 (_line, (_cond))
+#define ASSERT_STATIC(_cond) _ASSERT_STATIC0 (__LINE__, (_cond))
+
G_END_DECLS
#endif
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]