Fix 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-26 09:43:13 +02:00
parent 35db768ae5
commit 7dece41990
No known key found for this signature in database
54 changed files with 353 additions and 128 deletions

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

@ -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
@ -23,6 +23,7 @@
#include "lib/self_test.h"
#include "lib/allocators/DynamicArena.h"
#include "lib/types.h"
class TestDynamicArena : public CxxTest::TestSuite
{

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
@ -23,7 +23,6 @@
#include "lib/self_test.h"
#include "lib/allocators/dynarray.h"
#include "lib/byte_order.h"
class TestAllocators : public CxxTest::TestSuite
{

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
@ -23,6 +23,12 @@
#include "lib/self_test.h"
#include "lib/file/common/trace.h"
#include "lib/os_path.h"
#include "lib/path.h"
#include <climits>
#include <cwchar>
#include <string>
class TestTraceEntry : public CxxTest::TestSuite
{

View file

@ -28,7 +28,6 @@
#define INCLUDED_FILE_SYSTEM
#include "lib/os_path.h"
#include "lib/path.h"
#include "lib/posix/posix_filesystem.h"
#include "lib/posix/posix_types.h"
#include "lib/status.h"

View file

@ -38,7 +38,6 @@
#include "lib/os_path.h"
#include "lib/path.h"
#include "lib/posix/posix_filesystem.h"
#include "lib/posix/posix_types.h"
#include "lib/sysdep/filesystem.h"
#include <cerrno>

View file

@ -32,8 +32,10 @@
#include "lib/file/common/file_loader.h" // PIFileLoader
#include "lib/file/common/real_directory.h" // PRealDirectory
#include "lib/file/vfs/vfs_path.h"
#include "lib/path.h"
#include <ctime>
#include <memory>
#include <string>
class VfsFile

View file

@ -32,7 +32,6 @@
#include "lib/path.h"
#include "lib/regex.h"
#include "lib/secure_crt.h"
#include "lib/sysdep/filesystem.h"
#include <algorithm>
#include <climits>

View file

@ -30,7 +30,6 @@
#include "lib/file/file_system.h"
#include "lib/file/vfs/vfs.h"
#include "lib/file/vfs/vfs_path.h"
#include "lib/os_path.h"
#include "lib/status.h"
#include <cstddef>

View file

@ -22,34 +22,30 @@
#include "precompiled.h"
#include "lib/ogl.h"
#include "ogl.h"
#include "lib/config2.h"
#include "lib/debug.h"
#include "lib/external_libraries/libsdl.h"
#include "ps/CLogger.h"
#if !CONFIG2_GLES
#include <cstdarg>
#include <cstring>
#if !CONFIG2_GLES
# if OS_WIN
# include <glad/wgl.h>
# elif !OS_MACOSX
# include <SDL_syswm.h>
# if defined(SDL_VIDEO_DRIVER_X11)
# include <X11/Xlib.h>
# include <glad/glx.h>
# endif
# if defined(SDL_VIDEO_DRIVER_WAYLAND)
# include <glad/egl.h>
# endif
# endif
#endif // !CONFIG2_GLES
#include <stdio.h>
#include <string.h>
#include <stdarg.h>
//----------------------------------------------------------------------------
// extensions
//----------------------------------------------------------------------------

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
@ -23,6 +23,8 @@
#ifndef INCLUDED_PCH_STDLIB
#define INCLUDED_PCH_STDLIB
// IWYU pragma: begin_keep
#if !MINIMAL_PCH
// all new-form C library headers
#include <cassert>
@ -90,4 +92,6 @@
#include <valarray>
#endif // !MINIMAL_PCH
// IWYU pragma: end_keep
#endif // #ifndef INCLUDED_PCH_STDLIB

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
@ -24,5 +24,6 @@
# include "lib/sysdep/os/win/wposix/wpthread.h"
#else
# include <pthread.h>
# include <sched.h>
# include <semaphore.h>
#endif

View file

@ -39,19 +39,7 @@
# include "lib/sysdep/os/win/wposix/wposix_types.h"
#else
// unix/linux/glibc/gcc says that this macro has to be defined when including
// stdint.h from C++ for stdint.h to define SIZE_MAX and friends
# ifndef __STDC_LIMIT_MACROS
# define __STDC_LIMIT_MACROS
# endif
# include <math.h>
# include <wchar.h>
# include <sys/types.h>
# include <stddef.h>
# include <limits.h>
# include <cstdint>
# include <unistd.h>
#endif // #if !OS_WIN

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,7 +22,8 @@
#include "lib/self_test.h"
#include "lib/posix/posix.h"
#include <cstdlib>
#include <cwchar>
class TestPosix : public CxxTest::TestSuite
{

View file

@ -36,6 +36,8 @@
# define MINIMAL_PCH 0
#endif
// IWYU pragma: begin_keep
#include "lib/config.h" // CONFIG_ENABLE_PCH
#include "lib/sysdep/compiler.h" // MSC_VERSION
@ -100,4 +102,6 @@
#include "ps/CLogger.h"
#include "ps/Profile.h"
// IWYU pragma: end_keep
#endif // #if CONFIG_ENABLE_PCH

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
@ -30,9 +30,9 @@
#include "status.h"
#include "lib/secure_crt.h"
#include <cerrno>
#include <cstdio>
#include <cstring>
static StatusDefinitionBucket* buckets;

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
@ -161,6 +161,7 @@ To summarize: +/-1SHHCC (S=subsystem, HH=header, CC=code number)
#ifndef INCLUDED_STATUS
#define INCLUDED_STATUS
#include "lib/code_annotation.h"
#include "lib/types.h"
#include <cstddef>

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
@ -27,6 +27,8 @@
#ifndef INCLUDED_AMD64
#define INCLUDED_AMD64
#include "lib/sysdep/arch.h"
#if !ARCH_AMD64
#error "including amd64.h without ARCH_AMD64=1"
#endif

View file

@ -21,15 +21,20 @@
*/
#include "precompiled.h"
#include "lib/sysdep/arch/x86_x64/apic.h"
#include "apic.h"
#include "lib/bits.h"
#include "lib/code_annotation.h"
#include "lib/debug.h"
#include "lib/module_init.h"
#include "lib/status.h"
#include "lib/sysdep/arch/x86_x64/x86_x64.h"
#include "lib/sysdep/cpu.h" // ERR::CPU_FEATURE_MISSING
#include "lib/sysdep/os_cpu.h"
#include "lib/sysdep/arch/x86_x64/x86_x64.h"
#include <algorithm>
#include <cstdint>
ApicId GetApicId()
{

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,8 +25,6 @@
#include "lib/sysdep/arch/x86_x64/simd.h"
#if COMPILER_HAS_SSE
#include "lib/code_generation.h"
#include "lib/debug.h"
#include "lib/sysdep/arch.h"
#if ARCH_X86_X64

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,20 +25,23 @@
*/
#include "precompiled.h"
#include "lib/sysdep/arch/x86_x64/x86_x64.h"
#include <cstring>
#include <cstdio>
#include <vector>
#include <set>
#include <algorithm>
#include "x86_x64.h"
#include "lib/posix/posix_pthread.h"
#include "lib/bits.h"
#include "lib/timer.h"
#include "lib/code_annotation.h"
#include "lib/debug.h"
#include "lib/lib.h"
#include "lib/module_init.h"
#include "lib/posix/posix_pthread.h"
#include "lib/secure_crt.h"
#include "lib/status.h"
#include "lib/sysdep/cpu.h"
#include "lib/sysdep/os_cpu.h"
#include "lib/timer.h"
#include <algorithm>
#include <cstring>
#include <vector>
#if MSC_VERSION
# include <intrin.h> // __rdtsc

View file

@ -28,6 +28,10 @@
#define INCLUDED_X86_X64
#include "lib/sysdep/arch.h"
#include "lib/sysdep/compiler.h"
#include "lib/types.h"
#include <cstddef>
#if !ARCH_X86_X64
#error "including x86_x64.h without ARCH_X86_X64=1"

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,7 +25,13 @@
*/
#include "precompiled.h"
#include "lib/sysdep/cpu.h"
#include "cpu.h"
#include "lib/code_annotation.h"
#include "lib/types.h"
#include <cstdint>
static const StatusDefinition cpuStatusDefinitions[] = {
{ ERR::CPU_FEATURE_MISSING, L"This CPU doesn't support a required feature" },

View file

@ -28,9 +28,9 @@
#define INCLUDED_CPU
#include "lib/status.h"
#include "lib/sysdep/arch.h"
#include "lib/sysdep/compiler.h"
namespace ERR
{
const Status CPU_FEATURE_MISSING = -130000;

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,6 +28,7 @@
#define INCLUDED_DIR_WATCH
#include "lib/os_path.h"
#include "lib/status.h"
#include <vector>
#include <memory>

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
@ -23,13 +23,27 @@
#include "precompiled.h"
#include "lib/sysdep/dir_watch.h"
#include "lib/sysdep/sysdep.h"
#include "lib/debug.h"
#include "lib/os_path.h"
#include "lib/path.h"
#include "lib/posix/posix_pthread.h"
#include "lib/posix/posix_types.h"
#include "lib/status.h"
#include "ps/CLogger.h"
#include <cerrno>
#include <climits>
#include <cstddef>
#include <cstdint>
#include <cstdlib>
#include <map>
#include <memory>
#include <string>
#include <sys/inotify.h>
#include <sys/select.h>
#include <utility>
#include <vector>
struct NotificationEvent
{

View file

@ -23,10 +23,20 @@
#include "precompiled.h"
#include "lib/sysdep/os_cpu.h"
#include "lib/alignment.h"
#include "lib/bits.h"
#include "lib/config2.h"
#include "lib/debug.h"
#include "lib/module_init.h"
#include "lib/posix/posix_pthread.h"
#include "lib/posix/posix_types.h"
#include "lib/status.h"
#include "lib/sysdep/os.h"
#include <cerrno>
#include <cstddef>
#include <cstdint>
#if CONFIG2_VALGRIND
# include "valgrind.h"

View file

@ -30,11 +30,20 @@
#include "precompiled.h"
#include "lib/sysdep/sysdep.h"
#include "lib/debug.h"
#include "lib/code_annotation.h"
#include "lib/posix/posix_types.h"
#include "lib/secure_crt.h"
#include "lib/status.h"
#include "lib/sysdep/os.h"
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cwchar>
#include <string>
#include <sys/syscall.h>
#if OS_ANDROID

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2014 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,8 +22,13 @@
#include "precompiled.h"
#include "lib/sysdep/sysdep.h"
#include "lib/os_path.h"
#include "lib/posix/posix_types.h"
#include "lib/sysdep/os/unix/unix_executable_pathname.h"
#include "lib/sysdep/sysdep.h"
#include <climits>
#include <cstring>
static bool getPathFromProc(char* buffer, size_t length)
{

View file

@ -29,14 +29,17 @@ symbol lookups and backtraces)
#include "precompiled.h"
#include <cstdio>
#include <sys/types.h>
#include <signal.h>
#include "lib/timer.h"
#include "lib/sysdep/sysdep.h"
#include "lib/debug.h"
#include "lib/utf8.h"
#include "lib/posix/posix_types.h"
#include "lib/status.h"
#include "lib/sysdep/os.h"
#include <cstdio>
#ifndef NDEBUG
# include <signal.h>
#endif
Status debug_CaptureContext(void* /*context*/)

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,11 +25,22 @@
*/
#include "precompiled.h"
#include "lib/sysdep/filesystem.h"
#include "lib/path.h"
#include "lib/code_annotation.h"
#include "lib/debug.h"
#include "lib/os_path.h"
#include "lib/posix/posix_filesystem.h"
#include "lib/posix/posix_types.h"
#include "lib/secure_crt.h"
#include "lib/sysdep/os.h"
#include <climits>
#include <cstdio>
#include <cstdlib>
#include <fcntl.h>
#include <string>
struct WDIR
{

View file

@ -22,19 +22,25 @@
#include "precompiled.h"
#include <unistd.h>
#include <stdio.h>
#include <wchar.h>
#include "lib/code_annotation.h"
#include "lib/utf8.h"
#include "lib/debug.h"
#include "lib/os_path.h"
#include "lib/posix/posix_types.h"
#include "lib/secure_crt.h"
#include "lib/status.h"
#include "lib/sysdep/os.h"
#include "lib/sysdep/os/unix/udbg.h"
#include "lib/sysdep/sysdep.h"
#include "lib/types.h"
#include "lib/utf8.h"
#include <boost/algorithm/string/replace.hpp>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <string>
#define GNU_SOURCE
#include <dlfcn.h>
#include <sys/wait.h>

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2014 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
@ -24,12 +24,18 @@
#include "lib/sysdep/sysdep.h"
#include "lib/os_path.h"
#include "lib/posix/posix_dlfcn.h"
#include <climits>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#define GNU_SOURCE
#include "mocks/dlfcn.h"
#include "mocks/unistd.h"
#include <cstdio>
OsPath unix_ExecutablePathname()
{
// Find the executable's filename

View file

@ -21,11 +21,16 @@
*/
#include "precompiled.h"
#include "lib/sysdep/numa.h"
#include "lib/bits.h"
#include "lib/debug.h"
#include "lib/sysdep/os_cpu.h"
#include <cstddef>
#include <cstdint>
size_t numa_NumNodes()
{
return 1;

View file

@ -21,9 +21,16 @@
*/
#include "precompiled.h"
#include "lib/sysdep/vm.h"
#include "lib/alignment.h"
#include "lib/debug.h"
#include "lib/posix/posix_mman.h"
#include "lib/status.h"
#include <cerrno>
#include <cstddef>
#include <cstdint>
// "anonymous" effectively means mapping /dev/zero, but is more efficient.
// MAP_ANONYMOUS is not in SUSv3, but is a very common extension.

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,14 @@
*/
#include "precompiled.h"
#include "lib/sysdep/os_cpu.h"
#include "lib/alignment.h"
#include "lib/code_annotation.h"
#include "lib/sysdep/os.h"
#include "lib/sysdep/smbios.h"
#include "lib/types.h"
#if OS_WIN
# include "lib/sysdep/os/win/wcpu.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
@ -22,8 +22,11 @@
#include "precompiled.h"
#include "lib/sysdep/rtl.h"
#include "lib/bits.h"
#include "lib/sysdep/os.h"
#include "lib/sysdep/rtl.h"
#include <cstdlib>
// Linux glibc has posix_memalign and (obsolete) memalign
// Android libc has only memalign

View file

@ -29,8 +29,77 @@
#include "lib/types.h"
#include <cstddef>
#include <string>
namespace SMBIOS { struct Baseboard; }
namespace SMBIOS { struct BaseboardFlags; }
namespace SMBIOS { struct BaseboardType; }
namespace SMBIOS { struct Bios; }
namespace SMBIOS { struct BiosFlags1; }
namespace SMBIOS { struct BiosFlags2; }
namespace SMBIOS { struct BiosFlags; }
namespace SMBIOS { struct Cache; }
namespace SMBIOS { struct CacheAssociativity; }
namespace SMBIOS { struct CacheConfigurationFlags; }
namespace SMBIOS { struct CacheFlags; }
namespace SMBIOS { struct CacheLocation; }
namespace SMBIOS { struct CacheMode; }
namespace SMBIOS { struct CacheType; }
namespace SMBIOS { struct Chassis; }
namespace SMBIOS { struct ChassisSecurityStatus; }
namespace SMBIOS { struct ChassisType; }
namespace SMBIOS { struct CoolingDevice; }
namespace SMBIOS { struct CoolingDeviceType; }
namespace SMBIOS { struct ECC; }
namespace SMBIOS { struct ManagementDevice; }
namespace SMBIOS { struct ManagementDeviceAddressType; }
namespace SMBIOS { struct ManagementDeviceComponent; }
namespace SMBIOS { struct ManagementDeviceThreshold; }
namespace SMBIOS { struct ManagementDeviceType; }
namespace SMBIOS { struct MemoryArray; }
namespace SMBIOS { struct MemoryArrayLocation; }
namespace SMBIOS { struct MemoryArrayMappedAddress; }
namespace SMBIOS { struct MemoryArrayUse; }
namespace SMBIOS { struct MemoryDevice; }
namespace SMBIOS { struct MemoryDeviceFormFactor; }
namespace SMBIOS { struct MemoryDeviceMappedAddress; }
namespace SMBIOS { struct MemoryDeviceType; }
namespace SMBIOS { struct MemoryDeviceTypeFlags; }
namespace SMBIOS { struct OnBoardDeviceType; }
namespace SMBIOS { struct OnBoardDevices; }
namespace SMBIOS { struct OnboardDevices2; }
namespace SMBIOS { struct PortConnector; }
namespace SMBIOS { struct PortConnectorType; }
namespace SMBIOS { struct PortType; }
namespace SMBIOS { struct PortableBattery; }
namespace SMBIOS { struct PortableBatteryChemistry; }
namespace SMBIOS { struct Processor; }
namespace SMBIOS { struct ProcessorFlags; }
namespace SMBIOS { struct ProcessorStatus; }
namespace SMBIOS { struct ProcessorType; }
namespace SMBIOS { struct ProcessorUpgrade; }
namespace SMBIOS { struct State; }
namespace SMBIOS { struct System; }
namespace SMBIOS { struct SystemBoot; }
namespace SMBIOS { struct SystemBootStatus; }
namespace SMBIOS { struct SystemPowerSupply; }
namespace SMBIOS { struct SystemPowerSupplyCharacteristics; }
namespace SMBIOS { struct SystemPowerSupplyInputSwitching; }
namespace SMBIOS { struct SystemPowerSupplyType; }
namespace SMBIOS { struct SystemSlot; }
namespace SMBIOS { struct SystemSlotBusWidth; }
namespace SMBIOS { struct SystemSlotFlags1; }
namespace SMBIOS { struct SystemSlotFlags2; }
namespace SMBIOS { struct SystemSlotLength; }
namespace SMBIOS { struct SystemSlotType; }
namespace SMBIOS { struct SystemSlotUsage; }
namespace SMBIOS { struct SystemWakeUpType; }
namespace SMBIOS { struct TemperatureProbe; }
namespace SMBIOS { struct TemperatureProbeLocation; }
namespace SMBIOS { struct VoltageProbe; }
namespace SMBIOS { struct VoltageProbeLocation; }
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
@ -33,6 +33,12 @@
#include "lib/debug.h" // ErrorReactionInternal
#include "lib/os_path.h"
#include "lib/status.h"
#include "lib/sysdep/os.h"
#include "lib/types.h"
#include <cstdio>
#include <string>
//

View file

@ -22,10 +22,22 @@
#include "lib/self_test.h"
#include "lib/lib.h"
#include "lib/code_annotation.h"
#include "lib/os_path.h"
#include "lib/posix/posix_dlfcn.h"
#include "lib/posix/posix_filesystem.h"
#include "lib/posix/posix_types.h"
#include "lib/secure_crt.h"
#include "lib/sysdep/filesystem.h"
#include "lib/sysdep/os.h"
#include "lib/sysdep/sysdep.h"
#include "lib/types.h"
#include <climits>
#include <cstdio>
#include <cstdlib>
#include <cwchar>
#include <string>
#if OS_BSD || OS_LINUX
# include "lib/sysdep/os/unix/unix_executable_pathname.h"

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
@ -24,6 +24,9 @@
#include "lib/adts/ring_buf.h"
#include <algorithm>
#include <cstddef>
#include <deque>
#include <random>
class TestRingbuf : public CxxTest::TestSuite

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
@ -23,6 +23,7 @@
#include "lib/self_test.h"
#include "lib/fnv_hash.h"
#include "lib/types.h"
class TestFnvHash : public CxxTest::TestSuite
{

View file

@ -24,15 +24,18 @@
#include "tex.h"
#include "lib/alignment.h"
#include "lib/allocators/dynarray.h"
#include "lib/allocators/shared_ptr.h"
#include "lib/bits.h"
#include "lib/sysdep/cpu.h"
#include "lib/debug.h"
#include "lib/posix/posix_types.h"
#include "lib/tex/tex_codec.h"
#include "lib/timer.h"
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <cstdint>
#include <cstring>
static const StatusDefinition texStatusDefinitions[] =
{

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
@ -104,12 +104,18 @@ library and IO layer. Read and write are zero-copy.
#ifndef INCLUDED_TEX
#define INCLUDED_TEX
#include "lib/os_path.h"
#include "lib/code_annotation.h"
#include "lib/file/vfs/vfs_path.h"
#include "lib/allocators/dynarray.h"
#include "lib/os_path.h"
#include "lib/status.h"
#include "lib/types.h"
#include <cstddef>
#include <memory>
#include <vector>
struct DynArray;
namespace ERR
{
const Status TEX_UNKNOWN_FORMAT = -120100;

View file

@ -26,9 +26,18 @@
#include "precompiled.h"
#include "lib/byte_order.h"
#include "tex_codec.h"
#include "lib/byte_order.h"
#include "lib/code_annotation.h"
#include "lib/debug.h"
#include "lib/os_path.h"
#include "lib/status.h"
#include "lib/tex/tex.h"
#include "lib/types.h"
#include <cstdlib>
#pragma pack(push, 1)
struct BmpHeader

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2014 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 "tex_codec.h"
#include <string.h>
#include <stdlib.h>
#include "lib/allocators/shared_ptr.h" // ArrayDeleter
#include "tex.h"
#include "lib/allocators/dynarray.h"
#include "lib/debug.h"
#include "lib/posix/posix_types.h"
#include "lib/tex/tex.h"
#include "lib/tex/tex_internal.h"
// Statically allocate all of the codecs...
TexCodecDds DdsCodec;

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
@ -27,8 +27,16 @@
#ifndef INCLUDED_TEX_CODEC
#define INCLUDED_TEX_CODEC
#include "tex.h"
#include "tex_internal.h" // for codec's convenience
#include "lib/code_annotation.h"
#include "lib/os_path.h"
#include "lib/status.h"
#include "lib/types.h"
#include <cstddef>
#include <vector>
class Tex;
struct DynArray;
/**
* virtual method table for TexCodecs.

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2017 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,7 +28,9 @@
#define INCLUDED_TEX_INTERNAL
#include "lib/allocators/dynarray.h"
#include "lib/file/io/io.h" // io::Allocate
#include "lib/status.h"
#include <cstddef>
/**
* check if the given texture format is acceptable: 8bpp grey,

View file

@ -25,17 +25,18 @@
*/
#include "precompiled.h"
#include "lib/timer.h"
#include <cfloat>
#include <cmath>
#include <cstdarg>
#include <mutex>
#include <numeric>
#include <sstream> // std::stringstream
#include "timer.h"
#include "lib/module_init.h"
#include "lib/sysdep/cpu.h"
#include "lib/posix/posix_types.h"
#include "lib/status.h"
#include "lib/sysdep/os.h"
#include <algorithm>
#include <ctime>
#include <mutex>
#include <sstream>
#if OS_WIN
#include "lib/sysdep/os/win/win.h"

View file

@ -27,18 +27,20 @@
#ifndef INCLUDED_TIMER
#define INCLUDED_TIMER
#include "lib/code_annotation.h"
#include "lib/config2.h" // CONFIG2_TIMER_ALLOW_RDTSC
#include "lib/debug.h"
#include "lib/sysdep/arch.h"
#include "lib/utf8.h"
#include <cstdint>
#include <string>
#if ARCH_X86_X64 && CONFIG2_TIMER_ALLOW_RDTSC
# include "lib/sysdep/os_cpu.h" // os_cpu_ClockFrequency
# include "lib/sysdep/arch/x86_x64/x86_x64.h" // x86_x64::rdtsc
#endif
#include "lib/debug.h"
#include "lib/utf8.h"
#include <cstring>
/**
* timer_Time will subsequently return values relative to the current time.
**/

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
@ -27,7 +27,7 @@
#ifndef INCLUDED_TYPES
#define INCLUDED_TYPES
#include "lib/posix/posix_types.h"
#include <cstdint>
typedef int8_t i8;
typedef int16_t i16;

View file

@ -205,9 +205,9 @@ public:
CBoundingBoxOriented result;
flatAabb.Transform(transform, result);
TS_ASSERT(!isnan(result.m_Basis[0].X) && !isnan(result.m_Basis[0].Y) && !isnan(result.m_Basis[0].Z));
TS_ASSERT(!isnan(result.m_Basis[1].X) && !isnan(result.m_Basis[1].Y) && !isnan(result.m_Basis[1].Z));
TS_ASSERT(!isnan(result.m_Basis[2].X) && !isnan(result.m_Basis[2].Y) && !isnan(result.m_Basis[2].Z));
TS_ASSERT(!std::isnan(result.m_Basis[0].X) && !std::isnan(result.m_Basis[0].Y) && !std::isnan(result.m_Basis[0].Z));
TS_ASSERT(!std::isnan(result.m_Basis[1].X) && !std::isnan(result.m_Basis[1].Y) && !std::isnan(result.m_Basis[1].Z));
TS_ASSERT(!std::isnan(result.m_Basis[2].X) && !std::isnan(result.m_Basis[2].Y) && !std::isnan(result.m_Basis[2].Z));
}
void test_point_visibility()

View file

@ -82,6 +82,7 @@
#include "ps/ThreadUtil.h"
#include <cstdarg>
#include <cstring>
#include <mutex>
#include <string>
#include <thread>

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2021 Wildfire Games.
/* Copyright (C) 2025 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@ -208,7 +208,7 @@ public:
JS::RootedValue testNANVal(rq.cx);
Script::ToJSVal(rq, &testNANVal, NAN);
TS_ASSERT(Script::FromJSVal(rq, testNANVal, f));
TS_ASSERT(isnan(f));
TS_ASSERT(std::isnan(f));
}
// NOTE: fixed and vector conversions are defined in simulation2/scripting/EngineScriptConversions.cpp