[calls] util: Add STR_IS_NULL_OR_EMPTY macro
- From: Evangelos Ribeiro Tzaras <devrtz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [calls] util: Add STR_IS_NULL_OR_EMPTY macro
- Date: Tue, 22 Feb 2022 09:30:40 +0000 (UTC)
commit 53129e92af3d863e6951b521f3d49f5c88563ada
Author: Evangelos Ribeiro Tzaras <devrtz fortysixandtwo eu>
Date: Fri Feb 18 09:23:39 2022 +0100
util: Add STR_IS_NULL_OR_EMPTY macro
Shamelessly copied from
https://gitlab.gnome.org/World/Phosh/phosh/-/blob/main/src/util.h#L13
src/util.h | 2 ++
1 file changed, 2 insertions(+)
---
diff --git a/src/util.h b/src/util.h
index d2256457..4aa2d0a7 100644
--- a/src/util.h
+++ b/src/util.h
@@ -28,6 +28,8 @@
G_BEGIN_DECLS
+#define STR_IS_NULL_OR_EMPTY(x) ((x) == NULL || (x)[0] == '\0')
+
/*
* For defining simple interface functions
*/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]