mirror of
https://github.com/nicbarker/clay.git
synced 2025-04-19 20:58:03 +00:00
Try CLAY__INIT replacement
This commit is contained in:
parent
ee1e1bb95f
commit
9211595821
@ -1,9 +1,9 @@
|
||||
cmake_minimum_required(VERSION 3.28)
|
||||
project(clay)
|
||||
|
||||
if(MSVC)
|
||||
add_subdirectory("examples/cpp-project-example")
|
||||
elseif()
|
||||
if(!MSVC)
|
||||
add_subdirectory("examples/raylib-sidebar-scrolling-container")
|
||||
add_subdirectory("examples/clay-official-website")
|
||||
else()
|
||||
add_subdirectory("examples/cpp-project-example")
|
||||
endif()
|
8
clay.h
8
clay.h
@ -454,14 +454,16 @@ extern uint32_t Clay__debugViewWidth;
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define CLAY__ALIGNMENT(type) alignof(type)
|
||||
#define CLAY__INIT(type) type
|
||||
#elif
|
||||
#define CLAY__INIT(type) (type)
|
||||
#define CLAY__ALIGNMENT(type) (offsetof(struct { char c; type x; } a, a.x))
|
||||
#endif
|
||||
|
||||
bool Clay__warningsEnabled = true;
|
||||
|
||||
Clay_String CLAY__SPACECHAR = (Clay_String) { .length = 1, .chars = " " };
|
||||
Clay_String CLAY__STRING_DEFAULT = (Clay_String) { .length = 0, .chars = "" };
|
||||
Clay_String CLAY__SPACECHAR = CLAY__INIT(Clay_String) { .length = 1, .chars = " " };
|
||||
Clay_String CLAY__STRING_DEFAULT = CLAY__INIT(Clay_String) { .length = 0, .chars = "" };
|
||||
|
||||
typedef struct
|
||||
{
|
||||
@ -652,7 +654,7 @@ Clay_LayoutConfig *Clay__LayoutConfigArray_Add(Clay__LayoutConfigArray *array, C
|
||||
#pragma endregion
|
||||
// __GENERATED__ template
|
||||
|
||||
Clay_RectangleElementConfig CLAY__RECTANGLE_ELEMENT_CONFIG_DEFAULT = (Clay_RectangleElementConfig){0};
|
||||
Clay_RectangleElementConfig CLAY__RECTANGLE_ELEMENT_CONFIG_DEFAULT = (Clay_RectangleElementConfig){{0}};
|
||||
|
||||
// __GENERATED__ template array_define,array_add TYPE=Clay_RectangleElementConfig NAME=Clay__RectangleElementConfigArray DEFAULT_VALUE=&CLAY__RECTANGLE_ELEMENT_CONFIG_DEFAULT
|
||||
#pragma region generated
|
||||
|
@ -1,7 +1,5 @@
|
||||
cmake_minimum_required(VERSION 3.28)
|
||||
project(clay_examples_raylib_sidebar_scrolling_container)
|
||||
|
||||
target_compile_options(clay_examples_raylib_sidebar_scrolling_container PUBLIC -Wall -Werror -Wno-unknown-pragmas)
|
||||
project(clay_examples_raylib_sidebar_scrolling_container C)
|
||||
|
||||
# Adding Raylib
|
||||
include(FetchContent)
|
||||
@ -21,6 +19,7 @@ FetchContent_MakeAvailable(raylib)
|
||||
|
||||
add_executable(clay_examples_raylib_sidebar_scrolling_container main.c multi-compilation-unit.c)
|
||||
|
||||
target_compile_options(clay_examples_raylib_sidebar_scrolling_container PUBLIC -Wall -Werror -Wno-unknown-pragmas)
|
||||
target_include_directories(clay_examples_raylib_sidebar_scrolling_container PUBLIC .)
|
||||
|
||||
target_link_libraries(clay_examples_raylib_sidebar_scrolling_container PUBLIC raylib)
|
||||
|
Loading…
Reference in New Issue
Block a user