mirror of
https://github.com/Ed94/metadesk.git
synced 2026-06-12 23:51:37 -07:00
forgot about stb_sprintf.h...
This commit is contained in:
+3
-5
@@ -134,11 +134,9 @@ if ($code_sanity)
|
||||
$linker_args = @()
|
||||
$linker_args += $flag_link_win_subsystem_console
|
||||
|
||||
$path_base = join-path $path_code base
|
||||
|
||||
$includes = @( $path_base )
|
||||
$unit = join-path $path_code 'metadesk.c'
|
||||
$executable = join-path $path_build 'metadesk.lib'
|
||||
$includes = @( $path_code, $path_root )
|
||||
$unit = join-path $path_tests 'code_sanity.c'
|
||||
$executable = join-path $path_build 'code_sanity.exe'
|
||||
|
||||
$result = build-simple $path_build $includes $compiler_args $linker_args $unit $executable
|
||||
}
|
||||
|
||||
@@ -9,8 +9,16 @@
|
||||
# define BUILD_DEBUG 1
|
||||
#endif
|
||||
|
||||
#if ! defined(BUILD_SUPPLEMENTARY_UNIT)
|
||||
# define BUILD_SUPPLEMENTARY_UNIT 0
|
||||
#if ! defined(BUILD_STATIC)
|
||||
# define BUILD_STATIC 0
|
||||
#endif
|
||||
|
||||
#if ! defined(BUILD_DYANMIC)
|
||||
# define BUILD_DYANMIC 0
|
||||
#endif
|
||||
|
||||
#if ! defined(BUILD_API_EXPORT)
|
||||
# define BUILD_API_EXPORT 0
|
||||
#endif
|
||||
|
||||
#if !defined(BUILD_ENTRY_DEFINING_UNIT)
|
||||
|
||||
+4
-4
@@ -5,8 +5,8 @@
|
||||
|
||||
#ifndef MD_API
|
||||
#if COMPILER_MSVC
|
||||
# ifdef MD_DYN_LINK
|
||||
# ifdef MD_DYN_EXPORT
|
||||
# if BUILD_DYANMIC
|
||||
# if BUILD_API_EXPORT
|
||||
# define MD_API __declspec(dllexport)
|
||||
# else
|
||||
# define MD_API __declspec(dllimport)
|
||||
@@ -15,7 +15,7 @@
|
||||
# define MD_API // Empty for static builds
|
||||
# endif
|
||||
#else
|
||||
# ifdef MD_DYN_LINK
|
||||
# ifdef BUILD_DYANMIC
|
||||
# define MD_API __attribute__((visibility("default")))
|
||||
# else
|
||||
# define MD_API // Empty for static builds
|
||||
@@ -36,7 +36,7 @@
|
||||
#endif
|
||||
|
||||
#ifndef global // Global variables
|
||||
# if defined(MD_DYN_EXPORT) || defined(MD_STATIC_LINK)
|
||||
# if BUILD_API_EXPORT || BUILD_STATIC
|
||||
# define global
|
||||
# else
|
||||
# define global static
|
||||
|
||||
@@ -48,8 +48,6 @@ struct Log
|
||||
////////////////////////////////
|
||||
//~ rjf: Log Creation/Selection
|
||||
|
||||
|
||||
|
||||
Log* log_alloc(AllocatorInfo ainfo, U64 arena_block_size);
|
||||
void log_release(Log* log);
|
||||
MD_API void log_select (Log* log);
|
||||
|
||||
+3
-5
@@ -6,13 +6,11 @@
|
||||
# include "thread_context.h"
|
||||
////////////////////////////////
|
||||
//~ rjf: Third Party Includes
|
||||
#if !BUILD_SUPPLEMENTARY_UNIT
|
||||
# define STB_SPRINTF_IMPLEMENTATION
|
||||
# define STB_SPRINTF_STATIC
|
||||
# if BUILD_STATIC
|
||||
# #define STB_SPRINTF_STATIC
|
||||
# endif
|
||||
# include "third_party/stb/stb_sprintf.h"
|
||||
// Note(Ed): We should inject when generating the library segmented or singleheader
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// Copyright (c) 2024 Epic Games Tools
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
//~ rjf: Third Party Includes
|
||||
# define STB_SPRINTF_DECORATE(name) md_##name
|
||||
# include "third_party/stb/stb_sprintf.h"
|
||||
// Note(Ed): We should inject when generating the library segmented or singleheader
|
||||
#endif
|
||||
|
||||
// Copyright (c) 2024 Epic Games Tools
|
||||
|
||||
@@ -227,6 +227,9 @@ struct ParseResult
|
||||
typedef struct Context Context;
|
||||
struct Context
|
||||
{
|
||||
// Currently, this is only relevant if the user is utilizing this library via bindings
|
||||
// or they are not utilizing metadesk's hosted `entry_point` runtime
|
||||
|
||||
// Note: Only used so far as the first fallback if the user did not preset the thread_context's arenas
|
||||
// Otherwise it will just reserve its own Arena backed by chained virutal address space
|
||||
AllocatorInfo backing[2];
|
||||
|
||||
@@ -5,6 +5,12 @@
|
||||
|
||||
#include "base/platform.c"
|
||||
|
||||
#define STB_SPRINTF_IMPLEMENTATION
|
||||
#if BUILD_STATIC
|
||||
# #define STB_SPRINTF_STATIC
|
||||
#endif
|
||||
#include "third_party/stb/stb_sprintf.h"
|
||||
|
||||
MD_NS_BEGIN
|
||||
|
||||
#include "base/debug.c"
|
||||
|
||||
@@ -10,6 +10,9 @@
|
||||
#include "base/profiling.h"
|
||||
#include "base/namespace.h"
|
||||
|
||||
#define STB_SPRINTF_DECORATE(name) md_##name
|
||||
#include "third_party/stb/stb_sprintf.h"
|
||||
|
||||
MD_NS_BEGIN
|
||||
|
||||
#include "base/base_types.h"
|
||||
|
||||
@@ -1267,19 +1267,19 @@ win32_exception_filter(EXCEPTION_POINTERS* exception_ptrs)
|
||||
const U32 max_frames = 32;
|
||||
if(idx == max_frames)
|
||||
{
|
||||
buflen += wnsprintfW(buffer + buflen, ArrayCount(buffer) - buflen, L"...");
|
||||
break;
|
||||
buflen += wnsprintfW(buffer + buflen, ArrayCount(buffer) - buflen, L"...");
|
||||
break;
|
||||
}
|
||||
|
||||
if(!dbg_StackWalk64(image_type, process, thread, &frame, context, 0, dbg_SymFunctionTableAccess64, dbg_SymGetModuleBase64, 0))
|
||||
{
|
||||
break;
|
||||
break;
|
||||
}
|
||||
|
||||
U64 address = frame.AddrPC.Offset;
|
||||
if(address == 0)
|
||||
{
|
||||
break;
|
||||
break;
|
||||
}
|
||||
|
||||
if(idx==0)
|
||||
|
||||
@@ -4,5 +4,10 @@
|
||||
|
||||
int main()
|
||||
{
|
||||
Context ctx;
|
||||
init(& ctx);
|
||||
|
||||
|
||||
|
||||
deinit(& ctx);
|
||||
}
|
||||
|
||||
Vendored
+26
-26
@@ -151,25 +151,25 @@ PERFORMANCE vs MSVC 2008 32-/64-bit (GCC is even slower than MSVC):
|
||||
*/
|
||||
|
||||
#if defined(__clang__)
|
||||
# if defined(__has_feature) && defined(__has_attribute)
|
||||
# if __has_feature(address_sanitizer)
|
||||
# if __has_attribute(__no_sanitize__)
|
||||
# define STBSP__ASAN __attribute__((__no_sanitize__("address")))
|
||||
# elif __has_attribute(__no_sanitize_address__)
|
||||
# define STBSP__ASAN __attribute__((__no_sanitize_address__))
|
||||
# elif __has_attribute(__no_address_safety_analysis__)
|
||||
# define STBSP__ASAN __attribute__((__no_address_safety_analysis__))
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
# if defined(__has_feature) && defined(__has_attribute)
|
||||
# if __has_feature(address_sanitizer)
|
||||
# if __has_attribute(__no_sanitize__)
|
||||
# define STBSP__ASAN __attribute__((__no_sanitize__("address")))
|
||||
# elif __has_attribute(__no_sanitize_address__)
|
||||
# define STBSP__ASAN __attribute__((__no_sanitize_address__))
|
||||
# elif __has_attribute(__no_address_safety_analysis__)
|
||||
# define STBSP__ASAN __attribute__((__no_address_safety_analysis__))
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
#elif defined(__GNUC__) && (__GNUC__ >= 5 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8))
|
||||
# if defined(__SANITIZE_ADDRESS__) && __SANITIZE_ADDRESS__
|
||||
# define STBSP__ASAN __attribute__((__no_sanitize_address__))
|
||||
# endif
|
||||
# if defined(__SANITIZE_ADDRESS__) && __SANITIZE_ADDRESS__
|
||||
# define STBSP__ASAN __attribute__((__no_sanitize_address__))
|
||||
# endif
|
||||
#elif defined(_MSC_VER)
|
||||
# if defined(__SANITIZE_ADDRESS__)
|
||||
# define STBSP__ASAN __declspec(no_sanitize_address)
|
||||
# endif
|
||||
# if defined(__SANITIZE_ADDRESS__)
|
||||
# define STBSP__ASAN __declspec(no_sanitize_address)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef STBSP__ASAN
|
||||
@@ -177,16 +177,16 @@ PERFORMANCE vs MSVC 2008 32-/64-bit (GCC is even slower than MSVC):
|
||||
#endif
|
||||
|
||||
#ifdef STB_SPRINTF_STATIC
|
||||
#define STBSP__PUBLICDEC static STBSP__ASAN
|
||||
#define STBSP__PUBLICDEF static STBSP__ASAN
|
||||
# define STBSP__PUBLICDEC static STBSP__ASAN
|
||||
# define STBSP__PUBLICDEF static STBSP__ASAN
|
||||
#else
|
||||
#ifdef __cplusplus
|
||||
#define STBSP__PUBLICDEC extern "C" STBSP__ASAN
|
||||
#define STBSP__PUBLICDEF extern "C" STBSP__ASAN
|
||||
#else
|
||||
#define STBSP__PUBLICDEC extern STBSP__ASAN
|
||||
#define STBSP__PUBLICDEF STBSP__ASAN
|
||||
#endif
|
||||
# ifdef __cplusplus
|
||||
# define STBSP__PUBLICDEC extern "C" STBSP__ASAN
|
||||
# define STBSP__PUBLICDEF extern "C" STBSP__ASAN
|
||||
# else
|
||||
# define STBSP__PUBLICDEC extern STBSP__ASAN
|
||||
# define STBSP__PUBLICDEF STBSP__ASAN
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined(__has_attribute)
|
||||
|
||||
Reference in New Issue
Block a user