[gnome-builder] util: add gb_str_equal0() macro
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] util: add gb_str_equal0() macro
- Date: Mon, 13 Oct 2014 01:11:39 +0000 (UTC)
commit d2386e358779fd5798b9180df82a8d9a24bd6c7b
Author: Christian Hergert <christian hergert me>
Date: Sun Oct 12 21:01:02 2014 -0400
util: add gb_str_equal0() macro
This is convenience so that we can check if two strings are equal, where
NULL == NULL should also be considered equal.
src/util/gb-string.h | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/src/util/gb-string.h b/src/util/gb-string.h
index c5de323..eb27fc5 100644
--- a/src/util/gb-string.h
+++ b/src/util/gb-string.h
@@ -25,6 +25,8 @@ G_BEGIN_DECLS
#define gb_str_empty(s) (!*(s))
#define gb_str_empty0(s) (!(s) || gb_str_empty(s))
+#define gb_str_equal0(s1,s2) \
+ (((s1) == (s2)) || ((s1) && (s2) && g_str_equal(s1,s2)))
G_END_DECLS
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]