From efbd6806857eeacabbae62edb35e85f50460ea2b Mon Sep 17 00:00:00 2001 From: Simon Oelerich <54176035+gmasil@users.noreply.github.com> Date: Wed, 14 May 2025 03:29:12 +0200 Subject: [PATCH] [Core] restore compatibility with C99 (#412) --- clay.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/clay.h b/clay.h index 8cc13f8..1a45b3e 100644 --- a/clay.h +++ b/clay.h @@ -839,7 +839,7 @@ CLAY_DLL_EXPORT void Clay_SetCurrentContext(Clay_Context* context); CLAY_DLL_EXPORT void Clay_UpdateScrollContainers(bool enableDragScrolling, Clay_Vector2 scrollDelta, float deltaTime); // Returns the internally stored scroll offset for the currently open element. // Generally intended for use with clip elements to create scrolling containers. -CLAY_DLL_EXPORT Clay_Vector2 Clay_GetScrollOffset(); +CLAY_DLL_EXPORT Clay_Vector2 Clay_GetScrollOffset(void); // Updates the layout dimensions in response to the window or outer container being resized. CLAY_DLL_EXPORT void Clay_SetLayoutDimensions(Clay_Dimensions dimensions); // Called before starting any layout declarations. @@ -3997,24 +3997,23 @@ void Clay_SetCurrentContext(Clay_Context* context) { } CLAY_WASM_EXPORT("Clay_GetScrollOffset") -Clay_Vector2 Clay_GetScrollOffset() { +Clay_Vector2 Clay_GetScrollOffset(void) { Clay_Context* context = Clay_GetCurrentContext(); if (context->booleanWarnings.maxElementsExceeded) { - return CLAY__INIT(Clay_Vector2){}; + return CLAY__INIT(Clay_Vector2) CLAY__DEFAULT_STRUCT; } Clay_LayoutElement *openLayoutElement = Clay__GetOpenLayoutElement(); // If the element has no id attached at this point, we need to generate one if (openLayoutElement->id == 0) { Clay__GenerateIdForAnonymousElement(openLayoutElement); } - Clay_ClipElementConfig *clipConfig = Clay__FindElementConfigWithType(openLayoutElement, CLAY__ELEMENT_CONFIG_TYPE_CLIP).clipElementConfig; for (int32_t i = 0; i < context->scrollContainerDatas.length; i++) { Clay__ScrollContainerDataInternal *mapping = Clay__ScrollContainerDataInternalArray_Get(&context->scrollContainerDatas, i); if (mapping->layoutElement == openLayoutElement) { return mapping->scrollPosition; } } - return CLAY__INIT(Clay_Vector2){}; + return CLAY__INIT(Clay_Vector2) CLAY__DEFAULT_STRUCT; } CLAY_WASM_EXPORT("Clay_UpdateScrollContainers") -- 2.39.5