make CX_STR more robust when used in macro expansions

Sun, 23 Feb 2025 13:25:53 +0100

author
Mike Becker <universe@uap-core.de>
date
Sun, 23 Feb 2025 13:25:53 +0100
changeset 1224
e20e100fa71f
parent 1223
be4c13de7c4f
child 1225
086e63c8dd06

make CX_STR more robust when used in macro expansions

src/cx/string.h file | annotate | diff | comparison | revisions
--- a/src/cx/string.h	Sun Feb 23 13:15:07 2025 +0100
+++ b/src/cx/string.h	Sun Feb 23 13:25:53 2025 +0100
@@ -151,7 +151,7 @@
  *
  * @param literal the string literal
  */
-#define CX_STR(literal) (cxstring){literal, sizeof(literal) - 1}
+#define CX_STR(literal) ((cxstring){literal, sizeof(literal) - 1})
 
 #endif
 

mercurial