Compare commits

...

3 Commits

Author SHA1 Message Date
Harrison Lambeth
60c582590b
Merge c68a3ee136 into 40ae6d8894 2025-01-29 19:51:25 -07:00
Harrison Lambeth
40ae6d8894
Fix int conversion errors in msvc (#242)
Some checks failed
CMake on multiple platforms / build (Release, cl, cl, windows-latest) (push) Has been cancelled
CMake on multiple platforms / build (Release, clang, clang++, ubuntu-latest) (push) Has been cancelled
CMake on multiple platforms / build (Release, gcc, g++, ubuntu-latest) (push) Has been cancelled
2025-01-30 15:46:37 +13:00
Harrison Lambeth
c68a3ee136
Define CLAY_IMPLEMENTATION in Jetbrains IDE
[__JETBRAINS_IDE__](https://blog.jetbrains.com/clion/2017/02/clion-2017-1-eap-debugger-fixes-ide-macros-and-new-cmake/) is defined within Jetbrains editors like CLion and Rider. This is only defined inside the IDE, and does not affect builds, so we can use it to enable CLAY_IMPLEMENTATION to improve debugging & intellisense in this environment. I'm not sure if other IDEs have similar macros, but I figured we could start with this one
2025-01-28 21:45:35 -07:00

7
clay.h
View File

@ -14,6 +14,11 @@
#include <stdbool.h>
#include <stddef.h>
#ifdef __JETBRAINS_IDE__
// Help jetbrains IDEs like CLion and Rider with intellisense & debugging
#define CLAY_IMPLEMENTATION
#endif
// -----------------------------------------
// HEADER DECLARATIONS ---------------------
// -----------------------------------------
@ -990,7 +995,7 @@ uint32_t Clay__HashTextWithConfig(Clay_String *text, Clay_TextElementConfig *con
if (config->hashStringContents) {
uint32_t maxLengthToHash = CLAY__MIN(text->length, 256);
for (int i = 0; i < maxLengthToHash; i++) {
for (uint32_t i = 0; i < maxLengthToHash; i++) {
hash += text->chars[i];
hash += (hash << 10);
hash ^= (hash >> 6);