feat(libxce-alloc-preason-equality): NULL-safe str_eq helper in libxce utils (task 1.1)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Rongsong Shen 2026-09-28 09:21:04 +00:00
parent 094577f245
commit 8f25c1c3f3
Signed by untrusted user: rshen
GPG key ID: 80533536B0EB651C
4 changed files with 56 additions and 2 deletions

View file

@ -57,6 +57,11 @@
#define float_equal(a, b) (fabs((a) - (b)) < float_near_zero)
/* NULL-safe string equality: non-zero iff a and b are both NULL, or both
* non-NULL and strcmp(a, b) == 0; zero otherwise (exactly one NULL, or
* different contents). Reads only; never modifies either argument. */
extern int str_eq(const char* a, const char* b);
#define STR(x) _STR(x)
#define _STR(x) #x