mirror of
https://github.com/Ed94/VEFontCache-Odin.git
synced 2025-08-05 14:42:42 -07:00
using zpl for stb_truetype allocation extension instead of gb.h (trying to gamble a build with mac)
This commit is contained in:
BIN
thirdparty/stb/lib/stb_truetype.lib
vendored
BIN
thirdparty/stb/lib/stb_truetype.lib
vendored
Binary file not shown.
10827
thirdparty/stb/src/gb/gb.h
vendored
10827
thirdparty/stb/src/gb/gb.h
vendored
File diff suppressed because it is too large
Load Diff
14
thirdparty/stb/src/stb_truetype.h
vendored
14
thirdparty/stb/src/stb_truetype.h
vendored
@@ -415,9 +415,9 @@ int main(int arg, char **argv)
|
||||
#pragma region ODIN: CUSTOM ALLOCATOR
|
||||
|
||||
#ifdef STB_TRUETYPE_IMPLEMENTATION
|
||||
#define GB_IMPLEMENTATION
|
||||
#define ZPL_IMPLEMENTATION
|
||||
#endif
|
||||
#include "gb/gb.h"
|
||||
#include "zpl/zpl.h"
|
||||
|
||||
#ifdef STBTT_STATIC
|
||||
#define STBTT_DEF static
|
||||
@@ -429,21 +429,21 @@ int main(int arg, char **argv)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
STBTT_DEF void stbtt_SetAllocator( gbAllocator allocator );
|
||||
STBTT_DEF void stbtt_SetAllocator( zpl_allocator allocator );
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef STBTT_malloc
|
||||
#define STBTT_malloc(x,u) ((void)(u), gb_alloc(stbtt__allocator, x))
|
||||
#define STBTT_free(x,u) ((void)(u), gb_free(stbtt__allocator, x))
|
||||
#define STBTT_malloc(x,u) ((void)(u), zpl_alloc(stbtt__allocator, x))
|
||||
#define STBTT_free(x,u) ((void)(u), zpl_free(stbtt__allocator, x))
|
||||
#endif
|
||||
|
||||
#ifdef STB_TRUETYPE_IMPLEMENTATION
|
||||
gb_global gbAllocator stbtt__allocator = { gb_heap_allocator_proc, NULL };
|
||||
zpl_global zpl_allocator stbtt__allocator = { zpl_heap_allocator_proc, NULL };
|
||||
|
||||
STBTT_DEF void stbtt_SetAllocator( gbAllocator allocator ) {
|
||||
STBTT_DEF void stbtt_SetAllocator( zpl_allocator allocator ) {
|
||||
stbtt__allocator = allocator;
|
||||
}
|
||||
#endif
|
||||
|
19055
thirdparty/stb/src/zpl/zpl.h
vendored
Normal file
19055
thirdparty/stb/src/zpl/zpl.h
vendored
Normal file
File diff suppressed because it is too large
Load Diff
10
thirdparty/stb/truetype/stb_truetype.odin
vendored
10
thirdparty/stb/truetype/stb_truetype.odin
vendored
@@ -40,27 +40,27 @@ when ODIN_ARCH == .wasm32 || ODIN_ARCH == .wasm64p32 {
|
||||
// CUSTOM: ODIN COMPATIBLE ALLOCATOR
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
gbAllocationType :: enum(i32) {
|
||||
zpl_allocator_type :: enum(i32) {
|
||||
Alloc,
|
||||
Free,
|
||||
FreeAll,
|
||||
Resize,
|
||||
}
|
||||
|
||||
gbAllocatorProc :: #type proc(allocator_data: rawptr, type: gbAllocationType,
|
||||
zpl_allocator_proc :: #type proc(allocator_data: rawptr, type: zpl_allocator_type,
|
||||
size: c.ssize_t, alignment: c.ssize_t,
|
||||
old_memory: rawptr, old_size: c.ssize_t,
|
||||
flags : c.ulonglong
|
||||
) -> rawptr
|
||||
|
||||
gbAllocator :: struct {
|
||||
procedure: gbAllocatorProc,
|
||||
zpl_allocator :: struct {
|
||||
procedure: zpl_allocator_proc,
|
||||
data: rawptr,
|
||||
}
|
||||
|
||||
@(default_calling_convention="c", link_prefix="stbtt_")
|
||||
foreign stbtt {
|
||||
SetAllocator :: proc(allocator : gbAllocator) ---
|
||||
SetAllocator :: proc(allocator : zpl_allocator) ---
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
Reference in New Issue
Block a user