Skip to content

Commit

Permalink
Fix: Support 'old' GCC ABI
Browse files Browse the repository at this point in the history
The old ABI didn't support custom allocators for standard containers. So we'll disable the use of polymorphic allocators in that case.
  • Loading branch information
spnda committed Nov 5, 2023
1 parent 565c0a5 commit 3451d36
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions include/fastgltf/types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@
// Utils header already includes some headers, which we'll try and avoid including twice.
#include "util.hpp"

#if defined(_GLIBCXX_USE_CXX11_ABI) && !_GLIBCXX_USE_CXX11_ABI
// polymorphic allocators are only supported with the 'new' GCC ABI.
// Older compilers (older than GCC 5.1) default to the old ABI and sometimes the old ABI is
// explicitly selected on even the newest compilers, which we want to support.
#define FASTGLTF_DISABLE_CUSTOM_MEMORY_POOL 1
#endif

#ifndef FASTGLTF_DISABLE_CUSTOM_MEMORY_POOL
#define FASTGLTF_DISABLE_CUSTOM_MEMORY_POOL 0
#endif
Expand Down

0 comments on commit 3451d36

Please sign in to comment.