mirror of
https://github.com/raysan5/raygui.git
synced 2026-01-30 18:59:18 -05:00
Compare commits
2 Commits
ff866904d0
...
1736d71bd7
| Author | SHA1 | Date | |
|---|---|---|---|
| 1736d71bd7 | |||
| be051532d3 |
29
src/raygui.h
29
src/raygui.h
@ -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;
|
||||
|
||||
Reference in New Issue
Block a user