mirror of
https://github.com/nicbarker/clay.git
synced 2025-05-02 16:38:06 +00:00
Compare commits
5 Commits
aaf9363542
...
20ef8d121d
Author | SHA1 | Date | |
---|---|---|---|
|
20ef8d121d | ||
|
3f01ee4a4e | ||
|
a431254de4 | ||
|
63a74a92a8 | ||
|
8d3cadc52e |
@ -8,7 +8,7 @@ add_subdirectory("examples/cpp-project-example")
|
||||
# Don't try to compile C99 projects using MSVC
|
||||
if(NOT MSVC)
|
||||
add_subdirectory("examples/raylib-sidebar-scrolling-container")
|
||||
add_subdirectory("examples/cairo-pdf-rendering")
|
||||
# add_subdirectory("examples/cairo-pdf-rendering") Some issue with github actions populating cairo, disable for now
|
||||
add_subdirectory("examples/clay-official-website")
|
||||
add_subdirectory("examples/introducing-clay-video-demo")
|
||||
add_subdirectory("examples/SDL2-video-demo")
|
||||
|
8
clay.h
8
clay.h
@ -21,6 +21,14 @@
|
||||
#ifndef CLAY_HEADER
|
||||
#define CLAY_HEADER
|
||||
|
||||
#if !( \
|
||||
(defined(__cplusplus) && __cplusplus >= 202002L) || \
|
||||
(defined(__STDC__) && __STDC__ == 1 && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || \
|
||||
defined(_MSC_VER) \
|
||||
)
|
||||
#error "Clay requires C99, C++20, or MSVC"
|
||||
#endif
|
||||
|
||||
#ifdef CLAY_WASM
|
||||
#define CLAY_WASM_EXPORT(name) __attribute__((export_name(name)))
|
||||
#else
|
||||
|
24
fuzz/fuzzing_target.c
Normal file
24
fuzz/fuzzing_target.c
Normal file
@ -0,0 +1,24 @@
|
||||
#include "clay.h"
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
|
||||
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
|
||||
if (size < sizeof(Clay_String)) return 0;
|
||||
|
||||
Clay_String testString = { .length = size, .chars = (const char *)data };
|
||||
|
||||
Clay_Dimensions dimensions = MeasureText(&testString, NULL);
|
||||
|
||||
// Call other critical functions
|
||||
Clay_Arena arena = Clay_CreateArenaWithCapacityAndMemory(1024, (void*)data);
|
||||
Clay_Initialize(arena, (Clay_Dimensions){1024, 768});
|
||||
Clay_SetPointerState((Clay_Vector2){0, 0}, false);
|
||||
Clay_BeginLayout();
|
||||
Clay_EndLayout();
|
||||
|
||||
// Handle pointer state changes
|
||||
Clay_SetPointerState((Clay_Vector2){1, 1}, true);
|
||||
Clay_SetPointerState((Clay_Vector2){2, 2}, false);
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user