General Purpose library for Freestanding C++ and POSIX systems
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
 
 

71 rindas
1.8 KiB

#pragma once
#include <new>
#include <type_traits>
#include <cstddef>
#include <cstdint>
#include <cstdlib>
#ifdef GP_TESTS
class static_mapper;
#else
namespace gp {
class c_allocator;
}
#endif
namespace gp_config{
namespace rendering {
using default_type = float;
constexpr default_type epsilon = 0.001;
#define GP_CONFIG__RENDERING__COLOR_T vec4
}
namespace limits {
constexpr size_t max_processes = 4096;
constexpr size_t max_fd_per_process = 128;
constexpr size_t process_stack = 1024;
constexpr size_t process_stack_align_to = 16;
constexpr size_t stack_grow_upwards = false;
#if __cpp_lib_hardware_interference_size >= 201603
constexpr size_t hardware_constructive_interference_size = std::hardware_constructive_interference_size;
constexpr size_t hardware_destructive_interference_size = std::hardware_destructive_interference_size;
#else
constexpr size_t hardware_constructive_interference_size = 128;
constexpr size_t hardware_destructive_interference_size = 128;
#endif
}
namespace memory_module{
constexpr bool is_ok = true;
}
typedef uint32_t file_descriptor_t;
constexpr bool has_exceptions = true;
constexpr bool has_buffer_bounds = true;
// Value of 8 is considered not cryptographically secure
// Value of 12 offers a good compromise of performance and robustness
// Value of 20 offers maximum robustness
constexpr size_t arc4random_strength = 20;
struct assert_failure{
assert_failure(const char* reason)
: what_str{reason}
{}
const char* what_str;
const char* what() {return what_str;}
};
constexpr size_t assert_buffer_size = 0;
constexpr auto assertion = [](bool pred, const char* reason) -> void{
if constexpr (has_exceptions)
if(!pred) throw assert_failure(reason);
};
}
enum class gp_errorcodes : int {
infinite_skipstone = 3000
};