Fix some includes in source/lib

Make include-what-you-use happy with some files in source/lib and fix
what needs to be fixed.

Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
This commit is contained in:
Ralph Sennhauser 2025-07-06 20:15:27 +02:00
parent b32b018769
commit 4324dc1447
No known key found for this signature in database
52 changed files with 307 additions and 130 deletions

View file

@ -27,6 +27,9 @@
#ifndef INCLUDED_CACHE_ADT
#define INCLUDED_CACHE_ADT
#include "lib/debug.h"
#include <algorithm>
#include <cfloat>
#include <list>
#include <queue> // std::priority_queue

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2011 Wildfire Games.
/* Copyright (C) 2025 Wildfire Games.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
@ -27,6 +27,12 @@
#ifndef INCLUDED_ADTS_RING_BUF
#define INCLUDED_ADTS_RING_BUF
#include "lib/debug.h"
#include "lib/status.h"
#include <cstddef>
#include <iterator>
template<class T, size_t n> class RingBuf
{
size_t size_; // # of entries in buffer

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2011 Wildfire Games.
/* Copyright (C) 2025 Wildfire Games.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
@ -23,6 +23,8 @@
#ifndef INCLUDED_ALLOCATORS_ALLOCATOR_CHECKER
#define INCLUDED_ALLOCATORS_ALLOCATOR_CHECKER
#include "lib/debug.h"
#include <map>
/**

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2020 Wildfire Games.
/* Copyright (C) 2025 Wildfire Games.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
@ -25,13 +25,17 @@
*/
#include "precompiled.h"
#include "lib/allocators/dynarray.h"
#include "dynarray.h"
#include "lib/alignment.h"
#include "lib/debug.h"
#include "lib/posix/posix_types.h"
#include "lib/sysdep/vm.h"
#include <algorithm>
#include <cstdint>
#include <cstring>
#include <string>
static Status validate_da(DynArray* da)
{

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2011 Wildfire Games.
/* Copyright (C) 2025 Wildfire Games.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
@ -25,12 +25,15 @@
*/
#include "precompiled.h"
#include "lib/allocators/pool.h"
#include "pool.h"
#include "lib/alignment.h"
#include "lib/allocators/freelist.h"
#include "lib/timer.h"
#include "lib/types.h"
#include <algorithm>
namespace Allocators {

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2021 Wildfire Games.
/* Copyright (C) 2025 Wildfire Games.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
@ -21,10 +21,11 @@
*/
#include "precompiled.h"
#include "lib/allocators/shared_ptr.h"
#include "shared_ptr.h"
#include "lib/allocators/allocator_checker.h"
#include "lib/debug.h"
#ifndef NDEBUG
static AllocatorChecker s_allocatorChecker;

View file

@ -24,7 +24,7 @@
#define INCLUDED_ALLOCATORS_SHARED_PTR
#include "lib/alignment.h"
#include "lib/debug.h"
#include "lib/status.h"
#include "lib/sysdep/rtl.h" // rtl_AllocateAligned
#include "lib/types.h"

View file

@ -26,6 +26,7 @@
#include "lib/sysdep/rtl.h"
#include "lib/sysdep/vm.h"
#include <cstdlib>
#include <memory>
// NB: STL allocators are parameterized on the object type and indicate

View file

@ -22,9 +22,10 @@
#include "precompiled.h"
#include "lib/app_hooks.h"
#include "app_hooks.h"
#include "lib/sysdep/sysdep.h"
#include "lib/types.h"
#include <cstdio>

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2020 Wildfire Games.
/* Copyright (C) 2025 Wildfire Games.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
@ -25,7 +25,10 @@
*/
#include "precompiled.h"
#include "lib/bits.h"
#include "bits.h"
#include "lib/types.h"
#include <cstring>

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2020 Wildfire Games.
/* Copyright (C) 2025 Wildfire Games.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
@ -25,10 +25,12 @@
*/
#include "precompiled.h"
#include "lib/byte_order.h"
#include "byte_order.h"
#include "lib/bits.h"
#include <algorithm>
#include <cstring>
#ifndef swap16

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2024 Wildfire Games.
/* Copyright (C) 2025 Wildfire Games.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
@ -21,17 +21,27 @@
*/
#include "precompiled.h"
#include "lib/debug.h"
#include "debug.h"
#include "lib/alignment.h"
#include "lib/app_hooks.h"
#include "lib/fnv_hash.h"
#include "lib/os_path.h"
#include "lib/path.h"
#include "lib/secure_crt.h"
#include "lib/sysdep/sysdep.h"
#include "lib/sysdep/vm.h"
#include "lib/utf8.h"
#include <algorithm>
#include <cerrno>
#include <cstdarg>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cwchar>
#include <string>
#include <utility>
namespace
{

View file

@ -25,15 +25,20 @@
*/
#include "precompiled.h"
#include "lib/debug_stl.h"
#include "debug_stl.h"
#include "lib/code_annotation.h"
#include "lib/debug.h"
#include "lib/regex.h"
#include "lib/secure_crt.h"
#include "lib/sysdep/compiler.h"
#include "lib/sysdep/stl.h"
#include <cassert>
#include <cwchar>
#include <deque>
#include <list>
#include <map>
#include <set>
#include <new>
#include <vector>
static const StatusDefinition debugStlStatusDefinitions[] = {

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2010 Wildfire Games.
/* Copyright (C) 2025 Wildfire Games.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
@ -22,6 +22,7 @@
#include "precompiled.h"
#include "lib/sysdep/os.h"
#if OS_WIN
#include "lib/sysdep/sysdep.h"

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2022 Wildfire Games.
/* Copyright (C) 2025 Wildfire Games.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
@ -26,9 +26,9 @@
#include "lib/debug.h"
#include <SDL_error.h>
#include <SDL_syswm.h>
#if defined(SDL_VIDEO_DRIVER_X11) && !CONFIG2_GLES
void* GetX11Display(SDL_Window* window)
{

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2010 Wildfire Games.
/* Copyright (C) 2025 Wildfire Games.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
@ -25,7 +25,10 @@
*/
#include "precompiled.h"
#include "lib/file/archive/archive.h"
#include "archive.h"
#include "lib/code_annotation.h"
static const StatusDefinition archiveStatusDefinitions[] = {
{ ERR::ARCHIVE_UNKNOWN_FORMAT, L"Unknown archive format" },

View file

@ -36,8 +36,8 @@
#include "lib/types.h"
#include <cstdint>
#include <ctime>
#include <memory>
#include <time.h>
// rationale: this module doesn't build a directory tree of the entries
// within an archive. that task is left to the VFS; here, we are only

View file

@ -25,21 +25,37 @@
*/
#include "precompiled.h"
#include "lib/file/archive/archive_zip.h"
#include <time.h>
#include <limits>
#include "archive_zip.h"
#include "lib/utf8.h"
#include "lib/alignment.h"
#include "lib/allocators/dynarray.h"
#include "lib/allocators/pool.h"
#include "lib/bits.h"
#include "lib/byte_order.h"
#include "lib/allocators/pool.h"
#include "lib/sysdep/filesystem.h"
#include "lib/code_annotation.h"
#include "lib/debug.h"
#include "lib/file/archive/archive.h"
#include "lib/file/archive/codec.h"
#include "lib/file/archive/codec_zlib.h"
#include "lib/file/archive/stream.h"
#include "lib/file/file.h"
#include "lib/file/file_system.h"
#include "lib/file/io/io.h"
#include "lib/lib.h"
#include "lib/path.h"
#include "lib/posix/posix_types.h"
#include "lib/status.h"
#include "lib/types.h"
#include "lib/utf8.h"
#include <algorithm>
#include <cstdint>
#include <cstring>
#include <ctime>
#include <exception>
#include <memory>
#include <string>
//-----------------------------------------------------------------------------
// timestamp conversion: DOS FAT <-> Unix time_t

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2020 Wildfire Games.
/* Copyright (C) 2025 Wildfire Games.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
@ -21,14 +21,17 @@
*/
#include "precompiled.h"
#include "lib/file/archive/codec_zlib.h"
#include "codec_zlib.h"
#include "lib/alignment.h"
#include "lib/file/archive/codec.h"
#include "lib/debug.h"
#include "lib/external_libraries/zlib.h"
#include "lib/file/archive/codec.h"
#include "lib/status.h"
#include "lib/types.h"
#include "lib/sysdep/cpu.h"
#include <algorithm>
#include <cstring>
class Codec_ZLib : public ICodec

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2010 Wildfire Games.
/* Copyright (C) 2025 Wildfire Games.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
@ -21,10 +21,11 @@
*/
#include "precompiled.h"
#include "lib/file/archive/stream.h"
#include "lib/allocators/page_aligned.h"
#include "stream.h"
#include "lib/allocators/shared_ptr.h"
#include "lib/debug.h"
#include "lib/file/archive/codec.h"
//#include "lib/timer.h"

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2010 Wildfire Games.
/* Copyright (C) 2025 Wildfire Games.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
@ -25,13 +25,14 @@
*/
#include "precompiled.h"
#include "lib/file/common/file_stats.h"
#include <set>
#include "file_stats.h"
#if FILE_STATS_ENABLED
#include "lib/timer.h"
#if FILE_STATS_ENABLED
#include <set>
// vfs
static size_t vfs_files;

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2021 Wildfire Games.
/* Copyright (C) 2025 Wildfire Games.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
@ -21,11 +21,12 @@
*/
#include "precompiled.h"
#include "lib/file/common/real_directory.h"
#include "lib/sysdep/filesystem.h"
#include "lib/file/file.h"
#include "real_directory.h"
#include "lib/debug.h"
#include "lib/file/io/io.h"
#include "lib/path.h"
RealDirectory::RealDirectory(const OsPath& path, size_t priority, size_t flags)

View file

@ -25,14 +25,24 @@
*/
#include "precompiled.h"
#include "lib/file/common/trace.h"
#include <cstdio>
#include <sstream>
#include "trace.h"
#include "lib/allocators/dynarray.h"
#include "lib/allocators/pool.h"
#include "lib/timer.h" // timer_Time
#include "lib/code_annotation.h"
#include "lib/debug.h"
#include "lib/secure_crt.h"
#include "lib/sysdep/sysdep.h" // sys_OpenFile
#include "lib/timer.h" // timer_Time
#include <cerrno>
#include <clocale>
#include <cstdint>
#include <cstdio>
#include <cwchar>
#include <new>
#include <sstream>
/*virtual*/ ITrace::~ITrace()

View file

@ -35,9 +35,9 @@
#ifndef INCLUDED_TRACE
#define INCLUDED_TRACE
#include "lib/debug.h"
#include "lib/os_path.h"
#include "lib/path.h"
#include "lib/status.h"
#include <cstddef>
#include <memory>

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2010 Wildfire Games.
/* Copyright (C) 2025 Wildfire Games.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
@ -25,9 +25,16 @@
*/
#include "precompiled.h"
#include "lib/file/file.h"
#include "file.h"
#include "lib/code_annotation.h"
#include "lib/debug.h"
#include "lib/file/common/file_stats.h"
#include "lib/posix/posix_types.h"
#include "lib/sysdep/filesystem.h"
#include <cerrno>
static const StatusDefinition fileStatusDefinitions[] = {
{ ERR::FILE_ACCESS, L"Insufficient access rights to open file", EACCES },

View file

@ -21,10 +21,12 @@
*/
#include "precompiled.h"
#include "lib/file/io/io.h"
#include "io.h"
#include "lib/config2.h"
#include "lib/sysdep/rtl.h"
#include <cerrno>
static const StatusDefinition ioStatusDefinitions[] = {
{ ERR::IO, L"Error during IO", EIO }

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2018 Wildfire Games.
/* Copyright (C) 2025 Wildfire Games.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
@ -21,13 +21,18 @@
*/
#include "precompiled.h"
#include "lib/file/io/write_buffer.h"
#include "lib/bits.h" // IsAligned
#include "lib/sysdep/cpu.h"
#include "write_buffer.h"
#include "lib/alignment.h"
#include "lib/allocators/shared_ptr.h"
#include "lib/bits.h" // IsAligned
#include "lib/debug.h"
#include "lib/file/io/io.h"
#include "lib/sysdep/rtl.h"
#include <algorithm>
#include <cstring>
static const size_t BLOCK_SIZE = 512*KiB;

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2021 Wildfire Games.
/* Copyright (C) 2025 Wildfire Games.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
@ -21,20 +21,28 @@
*/
#include "precompiled.h"
#include "lib/file/vfs/vfs.h"
#include "vfs.h"
#include "lib/alignment.h"
#include "lib/allocators/shared_ptr.h"
#include "lib/file/file_system.h"
#include "lib/code_annotation.h"
#include "lib/debug.h"
#include "lib/file/common/file_loader.h"
#include "lib/file/common/file_stats.h"
#include "lib/file/common/real_directory.h"
#include "lib/file/common/trace.h"
#include "lib/file/archive/archive.h"
#include "lib/file/io/io.h"
#include "lib/file/vfs/vfs_tree.h"
#include "lib/file/file.h"
#include "lib/file/file_system.h"
#include "lib/file/vfs/vfs_lookup.h"
#include "lib/file/vfs/vfs_populate.h"
#include "lib/file/vfs/vfs_tree.h"
#include "lib/path.h"
#include <ctime>
#include <map>
#include <mutex>
#include <thread>
#include <utility>
static const StatusDefinition vfsStatusDefinitions[] = {
{ ERR::VFS_DIR_NOT_FOUND, L"VFS directory not found" },

View file

@ -28,10 +28,10 @@
#ifndef INCLUDED_VFS
#define INCLUDED_VFS
#include "lib/debug.h"
#include "lib/file/file_system.h" // CFileInfo
#include "lib/file/vfs/vfs_path.h"
#include "lib/os_path.h"
#include "lib/status.h"
#include "lib/types.h"
#include <cstddef>

View file

@ -26,15 +26,22 @@
#include "precompiled.h"
#include "lib/file/vfs/vfs_lookup.h"
#include "lib/sysdep/filesystem.h"
#include "vfs_lookup.h"
#include "lib/debug.h"
#include "lib/file/common/real_directory.h"
#include "lib/file/file.h"
#include "lib/file/file_system.h"
#include "lib/file/vfs/vfs.h" // error codes
#include "lib/file/vfs/vfs_tree.h"
#include "lib/file/vfs/vfs_populate.h"
#include "lib/file/vfs/vfs_tree.h"
#include "lib/os_path.h"
#include "lib/path.h"
#include "lib/posix/posix_types.h"
#include "lib/sysdep/filesystem.h"
#include "lib/timer.h"
#include <cerrno>
#include <string>
static Status CreateDirectory(const OsPath& path)
{

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2021 Wildfire Games.
/* Copyright (C) 2025 Wildfire Games.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
@ -25,12 +25,22 @@
*/
#include "precompiled.h"
#include "lib/file/vfs/vfs_populate.h"
#include "vfs_populate.h"
#include "lib/code_annotation.h"
#include "lib/file/archive/archive.h"
#include "lib/file/archive/archive_zip.h"
#include "lib/file/vfs/vfs_tree.h"
#include "lib/file/vfs/vfs_lookup.h"
#include "lib/file/file_system.h"
#include "lib/file/vfs/vfs.h" // error codes
#include "lib/file/vfs/vfs_lookup.h"
#include "lib/file/vfs/vfs_path.h"
#include "lib/file/vfs/vfs_tree.h"
#include "lib/os_path.h"
#include "lib/path.h"
#include <cstddef>
#include <cstdint>
struct CompareFileInfoByName
{

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2024 Wildfire Games.
/* Copyright (C) 2025 Wildfire Games.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
@ -25,12 +25,18 @@
*/
#include "precompiled.h"
#include "lib/file/vfs/vfs_tree.h"
#include <cstdio>
#include <ctime>
#include "vfs_tree.h"
#include "lib/code_annotation.h"
#include "lib/debug.h"
#include "lib/file/common/file_stats.h"
#include "lib/secure_crt.h"
#include "lib/status.h"
#include <ctime>
#include <cwchar>
#include <utility>
//-----------------------------------------------------------------------------

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2019 Wildfire Games.
/* Copyright (C) 2025 Wildfire Games.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
@ -26,15 +26,19 @@
#include "precompiled.h"
#include "lib/file/vfs/vfs_util.h"
#include <cstdio>
#include <cstring>
#include <queue>
#include "vfs_util.h"
#include "lib/code_annotation.h"
#include "lib/path.h"
#include "lib/regex.h"
#include "lib/secure_crt.h"
#include "lib/sysdep/filesystem.h"
#include <algorithm>
#include <climits>
#include <queue>
#include <string>
#include <vector>
namespace vfs {

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2021 Wildfire Games.
/* Copyright (C) 2025 Wildfire Games.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
@ -27,6 +27,10 @@
#ifndef INCLUDED_FNV_HASH
#define INCLUDED_FNV_HASH
#include "lib/types.h"
#include <cstddef>
/**
* rationale: this algorithm was chosen because it delivers 'good' results
* for string data and is relatively simple. other good alternatives exist;

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2018 Wildfire Games.
/* Copyright (C) 2025 Wildfire Games.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
@ -21,7 +21,15 @@
*/
#include "precompiled.h"
#include "lib/frequency_filter.h"
#include "frequency_filter.h"
#include "lib/code_annotation.h"
#include "lib/debug.h"
#include <algorithm>
#include <cmath>
#include <cstddef>
static const double errorTolerance = 0.25;
static const double g_Sensitivity = 0.10;

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2022 Wildfire Games.
/* Copyright (C) 2025 Wildfire Games.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
@ -23,6 +23,8 @@
#ifndef INCLUDED_FREQUENCY_FILTER
#define INCLUDED_FREQUENCY_FILTER
#include <memory>
// calculate frequency of events (tuned for 100 Hz)
struct IFrequencyFilter
{

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2019 Wildfire Games.
/* Copyright (C) 2025 Wildfire Games.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
@ -23,6 +23,9 @@
#ifndef INCLUDED_HASH
#define INCLUDED_HASH
#include <cstddef>
#include <memory>
/**
* This function is the same as hash_combine, i.e. allows dropping the boost dependency just for this function.
*/

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2010 Wildfire Games.
/* Copyright (C) 2025 Wildfire Games.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
@ -25,15 +25,10 @@
*/
#include "precompiled.h"
#include "lib/lib.h"
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include "lib/app_hooks.h"
#include "lib/sysdep/sysdep.h"
#include "lib.h"
#include "lib/status.h"
//-----------------------------------------------------------------------------
// type conversion

View file

@ -60,6 +60,7 @@ scope
#ifndef INCLUDED_LIB
#define INCLUDED_LIB
#include "lib/debug.h"
#include "lib/types.h"
#include <cmath> // fabsf

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2024 Wildfire Games.
/* Copyright (C) 2025 Wildfire Games.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
@ -25,8 +25,10 @@
*/
#include "precompiled.h"
#include "lib/module_init.h"
#include "module_init.h"
#include "lib/debug.h"
#include "lib/sysdep/cpu.h"
// not yet initialized, or already shutdown

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2024 Wildfire Games.
/* Copyright (C) 2025 Wildfire Games.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
@ -27,6 +27,8 @@
#ifndef INCLUDED_MODULE_INIT
#define INCLUDED_MODULE_INIT
#include "lib/status.h"
#include <atomic>
/**

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2010 Wildfire Games.
/* Copyright (C) 2025 Wildfire Games.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
@ -25,10 +25,13 @@
*/
#include "precompiled.h"
#include "lib/path.h"
#include <cstring>
#include <cerrno>
#include "path.h"
#include "lib/code_annotation.h"
#include <climits>
#include <utility>
static const StatusDefinition pathStatusDefinitions[] = {
{ ERR::PATH_CHARACTER_ILLEGAL, L"illegal path character" },

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2010 Wildfire Games.
/* Copyright (C) 2025 Wildfire Games.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
@ -25,7 +25,13 @@
*/
#include "precompiled.h"
#include "lib/rand.h"
#include "rand.h"
#include "lib/debug.h"
#include "lib/status.h"
#include <cstdlib>
// avoids several common pitfalls; see discussion at
// http://www.azillionmonkeys.com/qed/random.html

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2022 Wildfire Games.
/* Copyright (C) 2025 Wildfire Games.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
@ -27,6 +27,8 @@
#ifndef INCLUDED_RAND
#define INCLUDED_RAND
#include <cstddef>
/**
* return random integer in [min, max).
* avoids several common pitfalls; see discussion at

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2020 Wildfire Games.
/* Copyright (C) 2025 Wildfire Games.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
@ -26,12 +26,17 @@
#include "precompiled.h"
#include "secure_crt.h"
#include "lib/code_generation.h"
#include "lib/debug.h"
#include <algorithm>
#include <cerrno>
#include <cinttypes>
#include <cstdarg>
#include <cstdio>
#include <cstring>
#include <cerrno>
#include <cstdarg>
#include "lib/secure_crt.h"
#if OS_ANDROID
# include <boost/algorithm/string/replace.hpp>

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2015 Wildfire Games.
/* Copyright (C) 2025 Wildfire Games.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
@ -27,10 +27,11 @@
#ifndef INCLUDED_SECURE_CRT
#define INCLUDED_SECURE_CRT
#include <stdarg.h>
#include "lib/code_annotation.h"
#include "lib/status.h"
#include <cstdarg>
namespace ERR
{
const Status STRING_NOT_TERMINATED = -100600;

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2022 Wildfire Games.
/* Copyright (C) 2025 Wildfire Games.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
@ -23,6 +23,10 @@
#ifndef INCLUDED_X86_X64_APIC
#define INCLUDED_X86_X64_APIC
#include "lib/types.h"
#include <cstddef>
typedef u8 ApicId; // not necessarily contiguous values
/**

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2022 Wildfire Games.
/* Copyright (C) 2025 Wildfire Games.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
@ -27,6 +27,7 @@
#ifndef INCLUDED_CPU
#define INCLUDED_CPU
#include "lib/status.h"
#include "lib/sysdep/compiler.h"

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2022 Wildfire Games.
/* Copyright (C) 2025 Wildfire Games.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
@ -23,6 +23,9 @@
#ifndef INCLUDED_NUMA
#define INCLUDED_NUMA
#include <cstddef>
#include <cstdint>
//-----------------------------------------------------------------------------
// node topology

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2022 Wildfire Games.
/* Copyright (C) 2025 Wildfire Games.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
@ -27,6 +27,8 @@
#ifndef INCLUDED_RTL
#define INCLUDED_RTL
#include <cstddef>
void* rtl_AllocateAligned(size_t size, size_t alignment);
void rtl_FreeAligned(void* alignedPointer);

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2022 Wildfire Games.
/* Copyright (C) 2025 Wildfire Games.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
@ -27,6 +27,10 @@
#ifndef INCLUDED_SMBIOS
#define INCLUDED_SMBIOS
#include "lib/types.h"
#include <string>
namespace SMBIOS {
// to introduce another enumeration:

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2022 Wildfire Games.
/* Copyright (C) 2025 Wildfire Games.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
@ -28,8 +28,11 @@
#ifndef INCLUDED_SYSDEP_VM
#define INCLUDED_SYSDEP_VM
#include "lib/alignment.h"
#include "lib/posix/posix_mman.h" // PROT_*
#include <cstdint>
namespace vm {
// committing large pages (2 MiB) instead of regular 4 KiB pages can