Updated locale gen

This commit is contained in:
2023-02-07 21:22:57 -08:00
parent 12dd50ef77
commit c3dbacde76
13 changed files with 343 additions and 60 deletions

View File

@ -17,8 +17,13 @@ target_include_directories(${DAWN_TARGET_NAME}
${CMAKE_CURRENT_LIST_DIR}
)
target_sources(${DAWN_TARGET_NAME}
PRIVATE
${DAWN_SHARED_SOURCES}
)
# Subdirs
add_subdirectory(assert)
add_subdirectory(asset)
add_subdirectory(display)
add_subdirectory(input)

View File

@ -1,9 +0,0 @@
# Copyright (c) 2022 Dominic Masters
#
# This software is released under the MIT License.
# https://opensource.org/licenses/MIT
target_sources(${DAWN_TARGET_NAME}
PRIVATE
assert.cpp
)

View File

@ -1,40 +0,0 @@
/**
* Copyright (c) 2022 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#include "assert.hpp"
#if ASSERTS_ENABLED == 0
#elif ASSERTS_ENABLED == 1
void assertTrue(bool_t x) {
if(x != true) {
throw "Assertion Failed";
free(0);
}
assert(x == true);
}
void assertFalse(bool_t x) {
assertTrue(!x);
}
void assertUnreachable() {
assertTrue(false);
}
void assertNotNull(void *pointer) {
assertTrue(pointer != nullptr && pointer != NULL);
}
void assertNull(void *pointer) {
assertTrue(pointer == NULL || pointer == nullptr);
}
void assertDeprecated() {
assertUnreachable();
}
#endif

View File

@ -1,68 +0,0 @@
/**
* Copyright (c) 2022 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#pragma once
#include "dawnlibs.hpp"
#define ASSERTS_ENABLED 1
#if ASSERTS_ENABLED == 0
static inline void assertTrue(bool_t x) {}
#elif ASSERTS_ENABLED == 1
/**
* Assert a given value to be true.
* @param x Value to assert as true.
*/
void assertTrue(bool_t x);
/**
* Asserts a given statement to be false.
* @param x Value to assert as false.
*/
void assertFalse(bool_t x);
/**
* Asserts that a given line of code is unreachable. Essentially a forced
* assertion failure, good for "edge cases"
*/
void assertUnreachable();
/**
* Assert a given pointer to not point to a null pointer.
* @param pointer Pointer to assert is not a null pointer.
*/
void assertNotNull(void *pointer);
/**
* Asserts a given pointer to be a nullptr.
* @param pointer Pointer to assert is nullptr.
*/
void assertNull(void *pointer);
/**
* Asserts a function as being deprecated.
*/
void assertDeprecated();
/**
* Asserts that a given map has a key.
*
* @param map Map to check.
* @param key Key to try and assert exists.
*/
template<typename K, typename V>
void assertMapHasKey(std::map<K,V> map, K key) {
assertTrue(map.find(key) != map.end());
}
#else
#define assertTrue assert
#endif