From 2e878892792e36f47a8ed5caea7bd56c75c1c626 Mon Sep 17 00:00:00 2001 From: Craig Barnes Date: Wed, 20 Oct 2021 17:05:36 +0100 Subject: 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. --- macros.h | 1 + 1 file changed, 1 insertion(+) (limited to 'macros.h') 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))) -- cgit v1.3