Revert "Death to C++"

This reverts commit 066ac22605.
This commit is contained in:
2026-03-11 19:15:36 -04:00
parent 066ac22605
commit 13f856cfbc
80 changed files with 39269 additions and 5672 deletions

25
vendor/clay/clay.h vendored
View File

@@ -154,7 +154,14 @@ static inline void Clay__SuppressUnusedLatchDefinitionVariableWarning(void) { (v
// CLAY(declarationStruct);
#define CLAY__WRAPPER_TYPE(type) Clay__##type##Wrapper
#define CLAY__WRAPPER_STRUCT(type) typedef struct { type wrapped; } CLAY__WRAPPER_TYPE(type)
// In C++, bypass the wrapper struct - MSVC doesn't support designated initializers
// in function-style casts through wrapper structs. Direct construction works fine.
#ifdef __cplusplus
#define CLAY__CONFIG_WRAPPER(type, ...) (CLAY__INIT(type) { __VA_ARGS__ })
#else
#define CLAY__CONFIG_WRAPPER(type, ...) (CLAY__INIT(CLAY__WRAPPER_TYPE(type)) { __VA_ARGS__ }).wrapped
#endif
#define CLAY_TEXT(text, textConfig) Clay__OpenTextElement(text, textConfig)
@@ -3145,6 +3152,14 @@ CLAY_DLL_EXPORT Clay_ElementIdArray Clay_GetPointerOverIds(void) {
return Clay_GetCurrentContext()->pointerOverIds;
}
// MSVC C++ cannot compile the debug view because it uses CLAY() macros with
// designated initializers in function-style casts. Stub it out in C++ mode.
#ifdef __cplusplus
void Clay__RenderDebugViewElementConfigHeader(Clay_String elementId, Clay__ElementConfigType type) { (void)elementId; (void)type; }
void Clay__RenderDebugViewColor(Clay_Color color, Clay_TextElementConfig *textConfig) { (void)color; (void)textConfig; }
void Clay__RenderDebugViewCornerRadius(Clay_CornerRadius cornerRadius, Clay_TextElementConfig *textConfig) { (void)cornerRadius; (void)textConfig; }
void Clay__RenderDebugView(void) {}
#else
#pragma region DebugTools
Clay_Color CLAY__DEBUGVIEW_COLOR_1 = {58, 56, 52, 255};
Clay_Color CLAY__DEBUGVIEW_COLOR_2 = {62, 60, 58, 255};
@@ -3372,12 +3387,6 @@ void Clay__RenderDebugLayoutSizing(Clay_SizingAxis sizing, Clay_TextElementConfi
}
}
#ifdef CLAY_DISABLE_DEBUG_VIEW
void Clay__RenderDebugViewElementConfigHeader(Clay_String elementId, Clay__ElementConfigType type) { (void)elementId; (void)type; }
void Clay__RenderDebugViewColor(Clay_Color color, Clay_TextElementConfig *textConfig) { (void)color; (void)textConfig; }
void Clay__RenderDebugViewCornerRadius(Clay_CornerRadius cornerRadius, Clay_TextElementConfig *textConfig) { (void)cornerRadius; (void)textConfig; }
void Clay__RenderDebugView(void) {}
#else
void Clay__RenderDebugViewElementConfigHeader(Clay_String elementId, Clay__ElementConfigType type) {
Clay__DebugElementConfigTypeLabelConfig config = Clay__DebugGetElementConfigTypeLabel(type);
Clay_Color backgroundColor = config.color;
@@ -3848,7 +3857,7 @@ void Clay__RenderDebugView(void) {
}
}
#pragma endregion
#endif // CLAY_DISABLE_DEBUG_VIEW
#endif // __cplusplus (debug view)
uint32_t Clay__debugViewWidth = 400;
Clay_Color Clay__debugViewHighlightColor = { 168, 66, 28, 100 };
@@ -4425,7 +4434,7 @@ void Clay_ResetMeasureTextCache(void) {
context->measureTextHashMap.length = 0;
context->measuredWords.length = 0;
context->measuredWordsFreeList.length = 0;
for (int32_t i = 0; i < context->measureTextHashMap.capacity; ++i) {
context->measureTextHashMap.internalArray[i] = 0;
}