Add versions of the CLAY_ID macros that take Clay_String

These are named CLAY_SID*.
This commit is contained in:
FintasticMan 2025-02-25 15:56:28 +01:00
parent 1fa8684e47
commit e1209c9ff5
No known key found for this signature in database
GPG Key ID: A00F1AB6DB1ED386

12
clay.h
View File

@ -67,11 +67,19 @@
#define CLAY_ID(label) CLAY_IDI(label, 0) #define CLAY_ID(label) CLAY_IDI(label, 0)
#define CLAY_IDI(label, index) Clay__HashString(CLAY_STRING(label), index, 0) #define CLAY_SID(label) CLAY_SIDI(label, 0)
#define CLAY_IDI(label, index) CLAY_SIDI(CLAY_STRING(label), index)
#define CLAY_SIDI(label, index) Clay__HashString(label, index, 0)
#define CLAY_ID_LOCAL(label) CLAY_IDI_LOCAL(label, 0) #define CLAY_ID_LOCAL(label) CLAY_IDI_LOCAL(label, 0)
#define CLAY_IDI_LOCAL(label, index) Clay__HashString(CLAY_STRING(label), index, Clay__GetParentElementId()) #define CLAY_SID_LOCAL(label) CLAY_SIDI_LOCAL(label, 0)
#define CLAY_IDI_LOCAL(label, index) CLAY_SIDI_LOCAL(CLAY_STRING(label), index)
#define CLAY_SIDI_LOCAL(label, index) Clay__HashString(label, index, Clay__GetParentElementId())
#define CLAY__STRING_LENGTH(s) ((sizeof(s) / sizeof((s)[0])) - sizeof((s)[0])) #define CLAY__STRING_LENGTH(s) ((sizeof(s) / sizeof((s)[0])) - sizeof((s)[0]))