Linux UE builds failed on the Core wrapper module: the Linux-only PerModuleInline.gen.cpp saw Standalone/Compat
shadow headers instead of the engine's, and WITH_EDITOR was redefined under -Werror. Compat headers now forward
to the engine headers with include_next for generated Linux module TUs (canonical Core TUs opt into the Compat
definitions via CoreNamespacePreamble.h); CoreMinimal.h undefines WITH_EDITOR first. VoxelForgeCore.Build.cs
enables that forwarding and AVX2 on Linux only; VoxelForge.Build.cs disables Unity on Linux only. Portability:
std::int64_t consistently in VoxelContentManager.cpp; grouped &&/|| in VoxelRedefinedDensityField.cpp. Linux-only
trace fields split Core generateTile / mesh copy / RMC stream build. Standalone Clang and GCC whole-view hashes
are unchanged vs 3202193. The Unreal spawn trace is blocked by the owner's new assets (SW route sweep fails).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016dhxM43dnWvUu2B5Ph1iG1
101 lines
2.9 KiB
C++
101 lines
2.9 KiB
C++
#pragma once
|
|
|
|
// Core implementation TUs opt into the standalone Unreal-shaped compatibility headers. UE's
|
|
// Linux-generated module TUs leave this unset so those same header names forward to the engine.
|
|
#define VFCORE_USE_COMPAT 1
|
|
|
|
// Every standard or platform header used by the copied implementation must be included before
|
|
// its wrapper opens vfcore::detail. This prevents system declarations from being nested in the
|
|
// private namespace when the implementation includes its Unreal-shaped compatibility headers.
|
|
#include <algorithm>
|
|
#include <array>
|
|
#include <atomic>
|
|
#include <bit>
|
|
#include <cassert>
|
|
#include <cctype>
|
|
#include <charconv>
|
|
#include <cfloat>
|
|
#include <chrono>
|
|
#include <cmath>
|
|
#include <condition_variable>
|
|
#include <cstdarg>
|
|
#include <cstddef>
|
|
#include <cstdint>
|
|
#include <cstdio>
|
|
#include <cstdlib>
|
|
#include <cstring>
|
|
#include <filesystem>
|
|
#include <fstream>
|
|
#include <functional>
|
|
#include <immintrin.h>
|
|
#include <initializer_list>
|
|
#include <iomanip>
|
|
#include <iostream>
|
|
#include <limits>
|
|
#include <map>
|
|
#include <math.h>
|
|
#include <memory>
|
|
#include <memory_resource>
|
|
#include <mutex>
|
|
#include <new>
|
|
#include <numeric>
|
|
#include <optional>
|
|
#include <shared_mutex>
|
|
#include <span>
|
|
#include <sstream>
|
|
#include <stdexcept>
|
|
#include <string>
|
|
#include <string_view>
|
|
#include <thread>
|
|
#include <type_traits>
|
|
#include <unordered_map>
|
|
#include <unordered_set>
|
|
#include <utility>
|
|
#include <variant>
|
|
#include <vector>
|
|
|
|
// VFJson is a small, stateless standalone input parser with no Unreal-shaped names. Keeping its
|
|
// value tree shared lets the viewer resolve its reference world and Core snapshot from one parse.
|
|
#include "Json.h"
|
|
#include "VoxelForgeCore/VoxelForgeCore.h"
|
|
#include "VoxelForgeCore/ThreadLocalStorage.h"
|
|
#include "VoxelForgeCore/SharedColumnCache.h"
|
|
#include "VoxelForgeCore/FloatingIslandInstrumentation.h"
|
|
|
|
// Keep Core's expression-level FMA behavior fixed regardless of the toolchain setting.
|
|
// Clang's "fast" mode ignores the pragma, so Core's runtime self-test rejects that build.
|
|
#if defined(__clang__)
|
|
#pragma clang fp contract(off)
|
|
#elif defined(_MSC_VER)
|
|
#pragma fp_contract(off)
|
|
#elif defined(__GNUC__)
|
|
#pragma GCC optimize ("fp-contract=off")
|
|
#else
|
|
#error "VoxelForge Core requires a compiler-specific FP contraction control"
|
|
#endif
|
|
|
|
namespace vfcore::fp_contract
|
|
{
|
|
#if defined(_MSC_VER)
|
|
#define VFCORE_FP_PROBE_NOINLINE __declspec(noinline)
|
|
#else
|
|
#define VFCORE_FP_PROBE_NOINLINE __attribute__((noinline))
|
|
#endif
|
|
|
|
[[maybe_unused]] static VFCORE_FP_PROBE_NOINLINE double multiplyAddProbe(
|
|
double a, double b, double c) noexcept
|
|
{
|
|
return a * b + c;
|
|
}
|
|
|
|
[[maybe_unused]] static bool selfTest() noexcept
|
|
{
|
|
volatile double a = 1.0 + 0x1p-27;
|
|
volatile double b = 1.0 - 0x1p-27;
|
|
volatile double c = -1.0;
|
|
return multiplyAddProbe(a, b, c) == 0.0;
|
|
}
|
|
|
|
#undef VFCORE_FP_PROBE_NOINLINE
|
|
}
|