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
  • Loading branch information
akien-mga committed Dec 12, 2024
1 parent 19e003b commit 0ba875e
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 @@ -191,6 +191,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 @@ -63,6 +63,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 0ba875e

Please sign in to comment.