Compare commits

2 Commits

Author SHA1 Message Date
1736d71bd7 Improve customizeability of allocator macros (#475)
Co-authored-by: Ray <raysan5@gmail.com>
2025-07-28 23:31:55 +02:00
be051532d3 Removed unpaired multi-line comment end (#497)
An unpaired multi-line comment end found it's way infront of a comment. I simply removed it.
2025-07-28 23:28:10 +02:00

View File

@ -365,17 +365,6 @@
//----------------------------------------------------------------------------------
// Defines and Macros
//----------------------------------------------------------------------------------
// Allow custom memory allocators
#ifndef RAYGUI_MALLOC
#define RAYGUI_MALLOC(sz) malloc(sz)
#endif
#ifndef RAYGUI_CALLOC
#define RAYGUI_CALLOC(n,sz) calloc(n,sz)
#endif
#ifndef RAYGUI_FREE
#define RAYGUI_FREE(p) free(p)
#endif
// Simple log system to avoid printf() calls if required
// NOTE: Avoiding those calls, also avoids const strings memory usage
#define RAYGUI_SUPPORT_LOG_INFO
@ -1057,12 +1046,24 @@ typedef enum {
#if defined(RAYGUI_IMPLEMENTATION)
#include <ctype.h> // required for: isspace() [GuiTextBox()]
#include <stdio.h> // Required for: FILE, fopen(), fclose(), fprintf(), feof(), fscanf(), snprintf(), vsnprintf() [GuiLoadStyle(), GuiLoadIcons()]
#include <stdlib.h> // Required for: malloc(), calloc(), free() [GuiLoadStyle(), GuiLoadIcons()]
#include <stdio.h> // Required for: FILE, fopen(), fclose(), fprintf(), feof(), fscanf(), snprintf(), vsprintf() [GuiLoadStyle(), GuiLoadIcons()]
#include <string.h> // Required for: strlen() [GuiTextBox(), GuiValueBox()], memset(), memcpy()
#include <stdarg.h> // Required for: va_list, va_start(), vfprintf(), va_end() [TextFormat()]
#include <math.h> // Required for: roundf() [GuiColorPicker()]
// Allow custom memory allocators
#if defined(RAYGUI_MALLOC) || defined(RAYGUI_CALLOC) || defined(RAYGUI_FREE)
#if !defined(RAYGUI_MALLOC) || !defined(RAYGUI_CALLOC) || !defined(RAYGUI_FREE)
#error "RAYGUI: if RAYGUI_MALLOC, RAYGUI_CALLOC, or RAYGUI_FREE is customized, all three must be customized"
#endif
#else
#include <stdlib.h> // Required for: malloc(), calloc(), free() [GuiLoadStyle(), GuiLoadIcons()]
#define RAYGUI_MALLOC(sz) malloc(sz)
#define RAYGUI_CALLOC(n,sz) calloc(n,sz)
#define RAYGUI_FREE(p) free(p)
#endif
#ifdef __cplusplus
#define RAYGUI_CLITERAL(name) name
#else
@ -5961,7 +5962,7 @@ static int GetCodepointNext(const char *text, int *codepointSize)
}
else if (0xe0 == (0xf0 & ptr[0]))
{
// 3 byte UTF-8 codepoint */
// 3 byte UTF-8 codepoint
if (((ptr[1] & 0xC0) ^ 0x80) || ((ptr[2] & 0xC0) ^ 0x80)) { return codepoint; } //10xxxxxx checks
codepoint = ((0x0f & ptr[0]) << 12) | ((0x3f & ptr[1]) << 6) | (0x3f & ptr[2]);
*codepointSize = 3;