Reorganise some files
This commit is contained in:
parent
54d4547e5f
commit
ad019541a4
@ -2,7 +2,7 @@
|
|||||||
#define DN_BASE_H
|
#define DN_BASE_H
|
||||||
|
|
||||||
#if defined(_CLANGD)
|
#if defined(_CLANGD)
|
||||||
#include "../dn_base_inc.h"
|
#include "../dn.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// NOTE: Macros
|
// NOTE: Macros
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
#define DN_CONTAINERS_CPP
|
#define DN_BASE_CONTAINERS_CPP
|
||||||
|
#if defined(_CLANGD)
|
||||||
#include "../dn_base_inc.h"
|
#include "../dn.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
DN_API void *DN_CArray2_InsertArray(void *data, DN_USize *size, DN_USize max, DN_USize elem_size, DN_USize index, void const *items, DN_USize count)
|
DN_API void *DN_CArray2_InsertArray(void *data, DN_USize *size, DN_USize max, DN_USize elem_size, DN_USize index, void const *items, DN_USize count)
|
||||||
{
|
{
|
||||||
@ -1439,8 +1440,7 @@ DN_API DN_Str16 DN_Slice_Str16RenderSpaceSeparated(DN_Arena *arena, DN_Slice<DN_
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined(DN_NO_DSMAP)
|
// NOTE: DN_DSMap
|
||||||
// NOTE: DN_DSMap //////////////////////////////////////////////////////////////////////////////////
|
|
||||||
DN_API DN_DSMapKey DN_DSMap_KeyU64NoHash(DN_U64 u64)
|
DN_API DN_DSMapKey DN_DSMap_KeyU64NoHash(DN_U64 u64)
|
||||||
{
|
{
|
||||||
DN_DSMapKey result = {};
|
DN_DSMapKey result = {};
|
||||||
@ -1474,4 +1474,3 @@ DN_API bool operator==(DN_DSMapKey lhs, DN_DSMapKey rhs)
|
|||||||
bool result = DN_DSMap_KeyEquals(lhs, rhs);
|
bool result = DN_DSMap_KeyEquals(lhs, rhs);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
#endif // !defined(DN_NO_DSMAP)
|
|
||||||
|
|||||||
@ -1,7 +1,9 @@
|
|||||||
#if !defined(DN_CONTAINERS_H)
|
#if !defined(DN_CONTAINERS_H)
|
||||||
#define DN_CONTAINERS_H
|
#define DN_CONTAINERS_H
|
||||||
|
|
||||||
#include "../dn_base_inc.h"
|
#if defined(_CLANGD)
|
||||||
|
#include "../dn.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
struct DN_Ring
|
struct DN_Ring
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,6 +1,8 @@
|
|||||||
#define DN_BASE_LEAK_CPP
|
#define DN_BASE_LEAK_CPP
|
||||||
|
|
||||||
#include "../dn_base_inc.h"
|
#if defined(_CLANGD)
|
||||||
|
#include "../dn.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
DN_API void DN_LeakTrackAlloc_(DN_LeakTracker *leak, void *ptr, DN_USize size, bool leak_permitted)
|
DN_API void DN_LeakTrackAlloc_(DN_LeakTracker *leak, void *ptr, DN_USize size, bool leak_permitted)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,4 +1,9 @@
|
|||||||
#include "../dn_base_inc.h"
|
#if !defined(DN_BASE_LEAK_H)
|
||||||
|
#define DN_BASE_LEAK_H
|
||||||
|
|
||||||
|
#if defined(_CLANGD)
|
||||||
|
#include "../dn_base_inc.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
enum DN_LeakAllocFlag
|
enum DN_LeakAllocFlag
|
||||||
{
|
{
|
||||||
@ -41,4 +46,4 @@ DN_API void DN_LeakDump_ (DN_LeakTracker *leak);
|
|||||||
#define DN_LeakTrackDealloc(leak, ptr) do { (void)ptr; } while (0)
|
#define DN_LeakTrackDealloc(leak, ptr) do { (void)ptr; } while (0)
|
||||||
#define DN_LeakDump(leak) do { } while (0)
|
#define DN_LeakDump(leak) do { } while (0)
|
||||||
#endif
|
#endif
|
||||||
|
#endif // DN_BASE_LEAK_H
|
||||||
|
|||||||
@ -1,6 +1,8 @@
|
|||||||
#define DN_BASE_LOG_CPP
|
#define DN_BASE_LOG_CPP
|
||||||
|
|
||||||
#include "../dn_base_inc.h"
|
#if defined(_CLANDG)
|
||||||
|
#include "../dn.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
static DN_LOGEmitFromTypeFVFunc *g_dn_base_log_emit_from_type_fv_func_;
|
static DN_LOGEmitFromTypeFVFunc *g_dn_base_log_emit_from_type_fv_func_;
|
||||||
static void *g_dn_base_log_emit_from_type_fv_user_context_;
|
static void *g_dn_base_log_emit_from_type_fv_user_context_;
|
||||||
|
|||||||
@ -1,7 +1,9 @@
|
|||||||
#if !defined(DN_BASE_LOG_H)
|
#if !defined(DN_BASE_LOG_H)
|
||||||
#define DN_BASE_LOG_H
|
#define DN_BASE_LOG_H
|
||||||
|
|
||||||
#include "../dn_base_inc.h"
|
#if defined(_CLANGD)
|
||||||
|
#include "../dn.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
enum DN_LOGType
|
enum DN_LOGType
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,7 +1,9 @@
|
|||||||
#if !defined(DN_BASE_OS_H)
|
#if !defined(DN_BASE_OS_H)
|
||||||
#define DN_BASE_OS_H
|
#define DN_BASE_OS_H
|
||||||
|
|
||||||
#include "../dn_base_inc.h"
|
#if defined(_CLANGD)
|
||||||
|
#include "../dn.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
// NOTE: OS primitives that the OS layer can provide for the base layer but is optional.
|
// NOTE: OS primitives that the OS layer can provide for the base layer but is optional.
|
||||||
|
|
||||||
|
|||||||
@ -2,22 +2,15 @@
|
|||||||
#define DN_NO_WINDOWS_H_REPLACEMENT_HEADER
|
#define DN_NO_WINDOWS_H_REPLACEMENT_HEADER
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "../dn_base_inc.h"
|
#define DN_H_WITH_OS 1
|
||||||
#include "../dn_os_inc.h"
|
#define DN_H_WITH_CORE 1
|
||||||
#include "../dn_inc.h"
|
#define DN_H_WITH_MATH 1
|
||||||
|
#define DN_H_WITH_HASH 1
|
||||||
#include "../dn_base_inc.cpp"
|
#define DN_H_WITH_HELPERS 1
|
||||||
#include "../dn_os_inc.cpp"
|
#define DN_H_WITH_ASYNC 1
|
||||||
#include "../dn_inc.cpp"
|
#define DN_H_WITH_NET 1
|
||||||
|
#include "../dn.h"
|
||||||
#include "../Extra/dn_math.h"
|
#include "../dn.cpp"
|
||||||
#include "../Extra/dn_helpers.h"
|
|
||||||
|
|
||||||
#include "../Extra/dn_math.cpp"
|
|
||||||
#include "../Extra/dn_helpers.cpp"
|
|
||||||
|
|
||||||
#include "../Extra/dn_net.h"
|
|
||||||
#include "../Extra/dn_net.cpp"
|
|
||||||
|
|
||||||
#if defined(DN_UNIT_TESTS_WITH_CURL)
|
#if defined(DN_UNIT_TESTS_WITH_CURL)
|
||||||
#define CURL_STATICLIB
|
#define CURL_STATICLIB
|
||||||
|
|||||||
@ -1,7 +1,9 @@
|
|||||||
#define DN_CORE_DEBUG_CPP
|
#define DN_CORE_DEBUG_CPP
|
||||||
|
|
||||||
#include "../dn_base_inc.h"
|
#if defined(_CLANGD)
|
||||||
#include "../dn_os_inc.h"
|
#define DN_H_WITH_OS 1
|
||||||
|
#include "../dn.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
DN_API DN_StackTraceWalkResult DN_StackTraceWalk(DN_Arena *arena, uint16_t limit)
|
DN_API DN_StackTraceWalkResult DN_StackTraceWalk(DN_Arena *arena, uint16_t limit)
|
||||||
{
|
{
|
||||||
|
|||||||
56
Source/dn.cpp
Normal file
56
Source/dn.cpp
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
#include "Base/dn_base.cpp"
|
||||||
|
#include "Base/dn_base_containers.cpp"
|
||||||
|
#include "Base/dn_base_log.cpp"
|
||||||
|
#include "Base/dn_base_leak.cpp"
|
||||||
|
|
||||||
|
#if DN_H_WITH_OS
|
||||||
|
#include "OS/dn_os_tls.cpp"
|
||||||
|
#include "OS/dn_os.cpp"
|
||||||
|
#include "OS/dn_os_allocator.cpp"
|
||||||
|
#include "OS/dn_os_containers.cpp"
|
||||||
|
#include "OS/dn_os_print.cpp"
|
||||||
|
#include "OS/dn_os_string.cpp"
|
||||||
|
|
||||||
|
#if defined(DN_PLATFORM_POSIX) || defined(DN_PLATFORM_EMSCRIPTEN)
|
||||||
|
#include "OS/dn_os_posix.cpp"
|
||||||
|
#elif defined(DN_PLATFORM_WIN32)
|
||||||
|
#include "OS/dn_os_w32.cpp"
|
||||||
|
#else
|
||||||
|
#error Please define a platform e.g. 'DN_PLATFORM_WIN32' to enable the correct implementation for platform APIs
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "OS/dn_os_stacktrace.cpp"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if DN_H_WITH_CORE
|
||||||
|
#include "dn_core.cpp"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if DN_H_WITH_MATH
|
||||||
|
#include "Extra/dn_math.cpp"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if DN_H_WITH_HASH
|
||||||
|
#include "Extra/dn_hash.cpp"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if DN_H_WITH_HELPERS
|
||||||
|
#include "Extra/dn_helpers.cpp"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if DN_H_WITH_ASYNC
|
||||||
|
#include "Extra/dn_async.cpp"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if DN_H_WITH_NET
|
||||||
|
#include "Extra/dn_net.cpp"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if DN_CPP_WITH_TESTS
|
||||||
|
#include "Extra/dn_tests.cpp"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if DN_CPP_WITH_DEMO
|
||||||
|
#include "Extra/dn_demo.cpp"
|
||||||
|
#endif
|
||||||
|
|
||||||
@ -1,10 +1,24 @@
|
|||||||
#if !defined(DN_BASE_INC_H)
|
#if !defined(DN_H)
|
||||||
#define DN_BASE_INC_H
|
#define DN_H
|
||||||
|
|
||||||
// NOTE: DN configuration
|
// NOTE: DN configuration
|
||||||
// All the following configuration options are optional. If omitted, DN has default behaviours to
|
// Enabling DN modules
|
||||||
// handle the various options.
|
// By including this mega header 'dn.h' you must define the following symbols to 0 or 1 in order
|
||||||
//
|
// to include the module's implementation into the library as follows
|
||||||
|
/*
|
||||||
|
#define DN_H_WITH_OS 1
|
||||||
|
#define DN_H_WITH_CORE 1
|
||||||
|
#define DN_H_WITH_MATH 1
|
||||||
|
#define DN_H_WITH_HASH 1
|
||||||
|
#define DN_H_WITH_HELPERS 1
|
||||||
|
#define DN_H_WITH_ASYNC 1
|
||||||
|
#define DN_H_WITH_NET 1
|
||||||
|
#include "dn.h"
|
||||||
|
|
||||||
|
#define DN_CPP_WITH_TESTS 1
|
||||||
|
#define DN_CPP_WITH_DEMO 1
|
||||||
|
#include "dn.cpp"
|
||||||
|
*/
|
||||||
// Platform Target
|
// Platform Target
|
||||||
// Define one of the following directives to configure this library to compile for that platform.
|
// Define one of the following directives to configure this library to compile for that platform.
|
||||||
// By default, the library will auto-detect the current host platform and select that as the
|
// By default, the library will auto-detect the current host platform and select that as the
|
||||||
@ -60,4 +74,45 @@
|
|||||||
#include "Base/dn_base_containers.h"
|
#include "Base/dn_base_containers.h"
|
||||||
#include "Base/dn_base_leak.h"
|
#include "Base/dn_base_leak.h"
|
||||||
|
|
||||||
#endif // !defined(DN_BASE_INC_H)
|
#if DN_H_WITH_OS
|
||||||
|
#if defined(DN_PLATFORM_WIN32)
|
||||||
|
#include "OS/dn_os_windows.h"
|
||||||
|
#include "OS/dn_os_w32.h"
|
||||||
|
#elif defined(DN_PLATFORM_POSIX) || defined(DN_PLATFORM_EMSCRIPTEN)
|
||||||
|
#include "OS/dn_os_posix.h"
|
||||||
|
#else
|
||||||
|
#error Please define a platform e.g. 'DN_PLATFORM_WIN32' to enable the correct implementation for platform APIs
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "OS/dn_os_tls.h"
|
||||||
|
#include "OS/dn_os.h"
|
||||||
|
#include "OS/dn_os_allocator.h"
|
||||||
|
#include "OS/dn_os_containers.h"
|
||||||
|
#include "OS/dn_os_print.h"
|
||||||
|
#include "OS/dn_os_string.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if DN_H_WITH_CORE
|
||||||
|
#include "dn_core.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if DN_H_WITH_MATH
|
||||||
|
#include "Extra/dn_math.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if DN_H_WITH_HASH
|
||||||
|
#include "Extra/dn_hash.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if DN_H_WITH_HELPERS
|
||||||
|
#include "Extra/dn_helpers.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if DN_H_WITH_ASYNC
|
||||||
|
#include "Extra/dn_async.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if DN_H_WITH_NET
|
||||||
|
#include "Extra/dn_net.h"
|
||||||
|
#endif
|
||||||
|
#endif // !defined(DN_H)
|
||||||
@ -1,6 +0,0 @@
|
|||||||
#define DN_BASE_INC_CPP
|
|
||||||
|
|
||||||
#include "Base/dn_base.cpp"
|
|
||||||
#include "Base/dn_base_containers.cpp"
|
|
||||||
#include "Base/dn_base_log.cpp"
|
|
||||||
#include "Base/dn_base_leak.cpp"
|
|
||||||
@ -1,18 +0,0 @@
|
|||||||
#define DN_OS_INC_CPP
|
|
||||||
|
|
||||||
#include "OS/dn_os_tls.cpp"
|
|
||||||
#include "OS/dn_os.cpp"
|
|
||||||
#include "OS/dn_os_allocator.cpp"
|
|
||||||
#include "OS/dn_os_containers.cpp"
|
|
||||||
#include "OS/dn_os_print.cpp"
|
|
||||||
#include "OS/dn_os_string.cpp"
|
|
||||||
|
|
||||||
#if defined(DN_PLATFORM_POSIX) || defined(DN_PLATFORM_EMSCRIPTEN)
|
|
||||||
#include "OS/dn_os_posix.cpp"
|
|
||||||
#elif defined(DN_PLATFORM_WIN32)
|
|
||||||
#include "OS/dn_os_w32.cpp"
|
|
||||||
#else
|
|
||||||
#error Please define a platform e.g. 'DN_PLATFORM_WIN32' to enable the correct implementation for platform APIs
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "OS/dn_os_stacktrace.cpp"
|
|
||||||
@ -1,20 +0,0 @@
|
|||||||
#if !defined(DN_OS_INC_H)
|
|
||||||
#define DN_OS_INC_H
|
|
||||||
|
|
||||||
#if defined(DN_PLATFORM_WIN32)
|
|
||||||
#include "OS/dn_os_windows.h"
|
|
||||||
#include "OS/dn_os_w32.h"
|
|
||||||
#elif defined(DN_PLATFORM_POSIX) || defined(DN_PLATFORM_EMSCRIPTEN)
|
|
||||||
#include "OS/dn_os_posix.h"
|
|
||||||
#else
|
|
||||||
#error Please define a platform e.g. 'DN_PLATFORM_WIN32' to enable the correct implementation for platform APIs
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "OS/dn_os_tls.h"
|
|
||||||
#include "OS/dn_os.h"
|
|
||||||
#include "OS/dn_os_allocator.h"
|
|
||||||
#include "OS/dn_os_containers.h"
|
|
||||||
#include "OS/dn_os_print.h"
|
|
||||||
#include "OS/dn_os_string.h"
|
|
||||||
|
|
||||||
#endif // DN_OS_INC_H
|
|
||||||
@ -1,19 +1,17 @@
|
|||||||
#define USE_SINGLE_HEADER 1
|
#define USE_SINGLE_HEADER 1
|
||||||
|
|
||||||
|
#define DN_H_WITH_OS 1
|
||||||
|
#define DN_H_WITH_CORE 1
|
||||||
#if USE_SINGLE_HEADER
|
#if USE_SINGLE_HEADER
|
||||||
#include "Single-Header/dn_single_header.h"
|
#include "Single-Header/dn_single_header.h"
|
||||||
#else
|
#else
|
||||||
#include "Source/dn_base_inc.h"
|
#include "Source/dn.h"
|
||||||
#include "Source/dn_os_inc.h"
|
|
||||||
#include "Source/dn_inc.h"
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if USE_SINGLE_HEADER
|
#if USE_SINGLE_HEADER
|
||||||
#include "Single-Header/dn_single_header.cpp"
|
#include "Single-Header/dn_single_header.cpp"
|
||||||
#else
|
#else
|
||||||
#include "Source/dn_base_inc.cpp"
|
#include "Source/dn.cpp"
|
||||||
#include "Source/dn_os_inc.cpp"
|
|
||||||
#include "Source/dn_inc.cpp"
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
enum FileType
|
enum FileType
|
||||||
@ -94,12 +92,8 @@ int main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
File const FILES[] = {
|
File const FILES[] = {
|
||||||
{FileType_Header, DN_Str8Lit("dn_base_inc.h")},
|
{FileType_Header, DN_Str8Lit("dn.h")},
|
||||||
{FileType_Header, DN_Str8Lit("dn_os_inc.h")},
|
{FileType_Impl, DN_Str8Lit("dn.cpp")},
|
||||||
{FileType_Header, DN_Str8Lit("dn_inc.h")},
|
|
||||||
{FileType_Impl, DN_Str8Lit("dn_base_inc.cpp")},
|
|
||||||
{FileType_Impl, DN_Str8Lit("dn_os_inc.cpp")},
|
|
||||||
{FileType_Impl, DN_Str8Lit("dn_inc.cpp")},
|
|
||||||
};
|
};
|
||||||
|
|
||||||
for (DN_ForIndexU(type, FileType_Count)) {
|
for (DN_ForIndexU(type, FileType_Count)) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user