aboutsummaryrefslogtreecommitdiff
path: root/macros.h
diff options
context:
space:
mode:
authorCraig Barnes <craigbarnes@protonmail.com>2021-10-20 16:05:36 +0000
committerCraig Barnes <craigbarnes@protonmail.com>2021-10-20 16:05:36 +0000
commit2e878892792e36f47a8ed5caea7bd56c75c1c626 (patch)
tree5a66e9eafd291c2f1aaa2ecf2ba48c46b5405e54 /macros.h
parentMerge branch 'nordiq' (diff)
osc: use STRLEN() macro to make parse_rgb() more self-documenting
The empty literals in the macro are to ensure the argument itself is a string literal, so it can't be used on anything else.
Diffstat (limited to 'macros.h')
-rw-r--r--macros.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/macros.h b/macros.h
index 7cfe777e..2ecda603 100644
--- a/macros.h
+++ b/macros.h
@@ -2,6 +2,7 @@
#define PASTE(a, b) a##b
#define XPASTE(a, b) PASTE(a, b)
+#define STRLEN(str) (sizeof("" str "") - 1)
#define DO_PRAGMA(x) _Pragma(#x)
#define VERCMP(x, y, cx, cy) ((cx > x) || ((cx == x) && (cy >= y)))