base progress

This commit is contained in:
2025-02-01 22:58:35 -05:00
parent 97e54f15a3
commit 078bf4b271
22 changed files with 101 additions and 94 deletions
+2 -1
View File
@@ -13,6 +13,7 @@
"type_traits": "cpp",
"xtr1common": "cpp",
"cstddef": "cpp",
"xmemory": "cpp"
"xmemory": "cpp",
"memory.h": "c"
}
}
+2 -2
View File
@@ -1,6 +1,6 @@
#ifdef MD_INTELLISENSE_DIRECTIVES
#pragma once
#include "rarena.h"
# pragma once
# include "arena.h"
#endif
// Copyright (c) 2024 Epic Games Tools
+3 -3
View File
@@ -1,7 +1,7 @@
#ifdef MD_INTELLISENSE_DIRECTIVES
#pragma once
#include "macros.h"
#include "base_types.h"
# pragma once
# include "macros.h"
# include "base_types.h"
#endif
// Copyright (c) 2024 Epic Games Tools
+3
View File
@@ -1,6 +1,9 @@
#ifdef MD_INTELLISENSE_DIRECTIVES
# pragma once
# include "context_cracking.h"
# include "linkage.h"
# include "macros.h"
# include "platform.h"
#endif
#if defined( MD_COMPILER_MSVC )
+2 -2
View File
@@ -1,6 +1,6 @@
#ifdef MD_INTELLISENSE_DIRECTIVES
#pragma once
#include "command_line.h"
# pragma once
# include "command_line.h"
#endif
// Copyright (c) 2024 Epic Games Tools
+2 -2
View File
@@ -1,6 +1,6 @@
#ifdef MD_INTELLISENSE_DIRECTIVES
#pragma once
#include "strings.h"
# pragma once
# include "strings.h"
#endif
// Copyright (c) 2024 Epic Games Tools
+5 -2
View File
@@ -1,6 +1,9 @@
#ifdef MD_INTELLISENSE_DIRECTIVES
#pragma once
#include "linkage.h"
# pragma once
# include "context_cracking.h"
# include "linkage.h"
# include "macros.h"
# include "base_types.h"
#endif
////////////////////////////////
+15 -15
View File
@@ -206,46 +206,46 @@
//~ rjf: Zero All Undefined Options
#if !defined(MD_ARCH_32BIT)
# define MD_ARCH_32BIT 0
# define MD_ARCH_32BIT 0
#endif
#if !defined(MD_ARCH_64BIT)
# define MD_ARCH_64BIT 0
# define MD_ARCH_64BIT 0
#endif
#if !defined(MD_ARCH_X64)
# define MD_ARCH_X64 0
# define MD_ARCH_X64 0
#endif
#if !defined(MD_ARCH_X86)
# define MD_ARCH_X86 0
# define MD_ARCH_X86 0
#endif
#if !defined(MD_ARCH_ARM64)
# define MD_ARCH_ARM64 0
# define MD_ARCH_ARM64 0
#endif
#if !defined(MD_ARCH_ARM32)
# define MD_ARCH_ARM32 0
# define MD_ARCH_ARM32 0
#endif
#if !defined(MD_COMPILER_MSVC)
# define MD_COMPILER_MSVC 0
# define MD_COMPILER_MSVC 0
#endif
#if !defined(MD-COMPILER_GCC)
# define MD_COMPILER_GCC 0
#if !defined(MD_COMPILER_GCC)
# define MD_COMPILER_GCC 0
#endif
#if !defined(MD_COMPILER_CLANG)
# define MD_COMPILER_CLANG 0
# define MD_COMPILER_CLANG 0
#endif
#if !defined(MD_OS_WINDOWS)
# define MD_OS_WINDOWS 0
# define MD_OS_WINDOWS 0
#endif
#if !defined(MD_OS_LINUX)
# define MD_OS_LINUX 0
# define MD_OS_LINUX 0
#endif
#if !defined(MD_OS_MAC)
# define MD_OS_MAC 0
# define MD_OS_MAC 0
#endif
#if !defined(MD_LANG_CPP)
# define MD_LANG_CPP 0
# define MD_LANG_CPP 0
#endif
#if !defined(MD_LANG_C)
# define MD_LANG_C 0
# define MD_LANG_C 0
#endif
////////////////////////////////
-3
View File
@@ -1,3 +0,0 @@
#if MD_INTELLISENSE_DIRECTIVES
#pragma once
#endif
+7 -5
View File
@@ -1,10 +1,12 @@
#ifdef MD_INTELLISENSE_DIRECTIVES
# pragma once
# include "context_cracking.h"
# include "linkage.h"
# include "command_line.h"
#endif
// Copyright (c) 2024 Epic Games Tools
// Licensed under the MIT license (https://opensource.org/license/mit/)
#ifndef BASE_ENTRY_POINT_H
#define BASE_ENTRY_POINT_H
internal void main_thread_base_entry_point(void (*entry_point)(CmdLine *cmdline), char **arguments, U64 arguments_count);
internal void supplement_thread_base_entry_point(void (*entry_point)(void *params), void *params);
#endif // BASE_ENTRY_POINT_H
+1 -2
View File
@@ -1,7 +1,6 @@
#ifdef MD_INTELLISENSE_DIRECTIVES
# pragma once
# include "cracking_arch.h"
# include "cracking_compiler.h"
# include "context_cracking.h"
#endif
#ifndef MD_API
+2 -1
View File
@@ -1,6 +1,7 @@
#if MD_INTELLISENSE_DIRECTIVES
# pragma once
# include "platform.h"
# include "context_cracking.h"
# include "linkage.h"
#endif
#ifndef local_persist
+7 -6
View File
@@ -1,12 +1,13 @@
#ifdef MD_INTELLISENSE_DIRECTIVES
# pragma once
# include "linkage.h"
# include "strings.h"
#endif
// Copyright (c) 2024 Epic Games Tools
// Licensed under the MIT license (https://opensource.org/license/mit/)
#ifndef BASE_MARKUP_H
#define BASE_MARKUP_H
internal void set_thread_name(String8 string);
internal void set_thread_namef(char *fmt, ...);
#define ThreadNameF(...) (set_thread_namef(__VA_ARGS__))
#define ThreadName(str) (set_thread_name(str))
#endif // BASE_MARKUP_H
#define ThreadName(str) (set_thread_name(str))
+4 -8
View File
@@ -1,10 +1,8 @@
#ifdef MD_INTELLISENSE_DIRECTIVES
#pragma once
#include "cracking_arch.h"
#include "cracking_compiler.h"
#include "cracking_os.h"
#include "linkage.h"
#include "macros.h"
# pragma once
# include "context_cracking.h"
# include "linkage.h"
# include "macros.h"
#endif
// Copyright (c) 2024 Epic Games Tools
@@ -651,5 +649,3 @@ internal U32 u32_from_rgba(Vec4F32 rgba);
internal void rng1s64_list_push(Arena *arena, Rng1S64List *list, Rng1S64 rng);
internal Rng1S64Array rng1s64_array_from_list(Arena *arena, Rng1S64List *list);
#endif // BASE_MATH_H
+20 -18
View File
@@ -1,7 +1,10 @@
#ifdef MD_INTELLISENSE_DIRECTIVES
#pragma once
#include "cracking_arch.h"
#include "macros.h"
# pragma once
# include "context_cracking.h"
# include "linkage.h"
# include "macros.h"
# include "platform.h"
# include "memory_substrate.h"
#endif
////////////////////////////////
@@ -278,26 +281,27 @@ MD_C_API void __asan_unpoison_memory_region(void const volatile *addr, size_t si
////////////////////////////////
//~ rjf: Misc. Helper Macros
#define Stringify_(S) #S
#define Stringify(S) Stringify_(S)
#define stringify_(S) #S
#define stringify(S) Stringify_(S)
#define Glue_(A,B) A##B
#define Glue(A,B) Glue_(A,B)
#define glue_(A,B) A ## B
#define glue(A,B) glue_(A,B)
#define ArrayCount(a) (sizeof(a) / sizeof((a)[0]))
#define array_count(a) (sizeof(a) / sizeof((a)[0]))
#define CeilIntegerDiv(a,b) (((a) + (b) - 1)/(b))
#define ceil_integer_div(a,b) (((a) + (b) - 1) / (b))
#define Swap(T,a,b) do{T t__ = a; a = b; b = t__;}while(0)
#define swap(T, a, b) do { T t__ = a; a = b; b = t__; } while(0)
#if ARCH_64BIT
# define IntFromPtr(ptr) ((U64)(ptr))
#elif ARCH_32BIT
# define IntFromPtr(ptr) ((U32)(ptr))
#if MD_ARCH_64BIT
# define int_from_ptr(ptr) ((U64)(ptr))
#elif MD_ARCH_32BIT
# define int_from_ptr(ptr) ((U32)(ptr))
#else
# error Missing pointer-to-integer cast for this architecture.
# error Missing pointer-to-integer cast for this architecture.
#endif
#define PtrFromInt(i) (void*)((U8*)0 + (i))
#define ptr_from_int(i) (void*)((U8*)0 + (i))
#define Compose64Bit(a,b) ((((U64)a) << 32) | ((U64)b));
#define AlignPow2(x,b) (((x) + (b) - 1)&(~((b) - 1)))
@@ -319,5 +323,3 @@ MD_C_API void __asan_unpoison_memory_region(void const volatile *addr, size_t si
#else
# define this_function_name __func__
#endif
+6 -4
View File
@@ -1,8 +1,10 @@
#ifdef MD_INTELLISENSE_DIRECTIVES
#pragma once
#include "base_types.h"
#include "macros.h"
#include "linkage.h"
# pragma once
# include "context_cracking.h"
# include "linkage.h"
# include "macros.h"
# include "linkage.h"
# include "base_types.h"
#endif
// This provides an alterntive memory strategy to HMH/Casey Muratori/RJF styled arenas
+2 -2
View File
@@ -1,10 +1,10 @@
#ifdef MD_INTELLISENSE_DIRECTIVES
# pragma once
# include "cracking_compiler.h"
# include "context_cracking.h"
#endif
// C++ namespace support
#if MD_DONT_USE_NAMESPACE || MD_COMPILER_C
#if MD_DONT_USE_NAMESPACE || MD_LANG_C
# if MD_COMPILER_C
# define MD_NS
# define MD_NS_BEGIN
+2 -2
View File
@@ -1,6 +1,6 @@
#ifdef MD_INTELLISENSE_DIRECTIVES
#pragma once
#include "platform.h"
# pragma once
# include "platform.h"
#endif
+4 -2
View File
@@ -1,16 +1,18 @@
#if MD_INTELLISENSE_DIRECTIVES
# pragma once
# include "context_cracking.h"
# include "linkage.h"
# include "macros.h"
#endif
#include <stdarg.h>
#include <stddef.h>
#if defined( MD_SYSTEM_WINDOWS )
#if defined( MD_OS_WINDOWS )
# include <intrin.h>
#endif
#if MD_COMPILER_C
#if MD_LANG_C
# include <assert.h>
# include <stdbool.h>
#endif
+4 -5
View File
@@ -1,9 +1,10 @@
#ifdef MD_INTELLISENSE_DIRECTIVES
# pragma once
#endif
// Copyright (c) 2024 Epic Games Tools
// Licensed under the MIT license (https://opensource.org/license/mit/)
#ifndef BASE_PROFILE_H
#define BASE_PROFILE_H
////////////////////////////////
//~ rjf: Zero Settings
@@ -70,5 +71,3 @@
#define ProfBeginFunction(...) ProfBegin(this_function_name)
#define ProfScope(...) DeferLoop(ProfBeginDynamic(__VA_ARGS__), ProfEnd())
#endif // BASE_PROFILE_H
+7 -8
View File
@@ -1,12 +1,11 @@
#ifdef MD_INTELLISENSE_DIRECTIVES
#pragma once
#include "cracking_arch.h"
#include "cracking_compiler.h"
#include "cracking_os.h"
#include "macros.h"
#include "linkage.h"
#include "base_types.h"
#include "memory.h"
# pragma once
# include "context_cracking.h"
# include "linkage.h"
# include "platform.h"
# include "macros.h"
# include "base_types.h"
# include "memory.h"
#endif
// Copyright (c) 2024 Epic Games Tools
+1 -1
View File
@@ -9,8 +9,8 @@
#include "base/context_cracking.h"
#include "base/linkage.h"
#include "base/macros.h"
#include "base/namespace.h"
#include "base/platform.h"
#include "base/namespace.h"
MD_NS_BEGIN