Skip to content

Commit

Permalink
Jolt: Fix multiple definition LTO linking issue with mingw-gcc
Browse files Browse the repository at this point in the history
(cherry picked from commit 0ba875e)
  • Loading branch information
akien-mga authored and Spartan322 committed Dec 15, 2024
1 parent c437dd0 commit b0ee280
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions modules/jolt_physics/spaces/jolt_layers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,10 @@ JoltLayers::JoltLayers() {
_allocate_object_layer(0);
}

// MinGW GCC using LTO will emit errors during linking if this is defined in the header file, implicitly or otherwise.
// Likely caused by this GCC bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94156
JoltLayers::~JoltLayers() = default;

JPH::ObjectLayer JoltLayers::to_object_layer(JPH::BroadPhaseLayer p_broad_phase_layer, uint32_t p_collision_layer, uint32_t p_collision_mask) {
const uint64_t collision = encode_collision(p_collision_layer, p_collision_mask);

Expand Down
1 change: 1 addition & 0 deletions modules/jolt_physics/spaces/jolt_layers.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ class JoltLayers final

public:
JoltLayers();
virtual ~JoltLayers();

JPH::ObjectLayer to_object_layer(JPH::BroadPhaseLayer p_broad_phase_layer, uint32_t p_collision_layer, uint32_t p_collision_mask);
void from_object_layer(JPH::ObjectLayer p_encoded_layer, JPH::BroadPhaseLayer &r_broad_phase_layer, uint32_t &r_collision_layer, uint32_t &r_collision_mask) const;
Expand Down

0 comments on commit b0ee280

Please sign in to comment.