Commit 5dbfaf2
committed
Fix SWIGWORDSIZE64 incorrectly set on macOS, breaking arm64 builds
On macOS (including Apple Silicon arm64), the system defines uint64_t
as `unsigned long long` in <cstdint>. However, SWIG's stdint.i maps
uint64_t to `unsigned long` when SWIGWORDSIZE64 is defined.
The previous condition `UNIX AND CMAKE_SIZEOF_VOID_P EQUAL 8` evaluates
to true on macOS because macOS is a POSIX-compliant 64-bit OS. This
causes SWIG to define uint64_t as `unsigned long`, while the compiler
sees it as `unsigned long long`, producing type mismatch errors in the
generated fastddsPYTHON_wrap.cxx:
error: cannot initialize return object of type
'std::vector<unsigned long> *'
with an rvalue of type 'std::vector<unsigned long long> *'
The fix excludes Apple platforms from setting SWIGWORDSIZE64. On Linux
x86_64 and aarch64, uint64_t is `unsigned long`, so SWIGWORDSIZE64
remains correct there. On macOS, SWIG's fallback (unsigned long long)
matches the system definition.
Tested on macOS 15 (Sequoia) with Apple Silicon (arm64), SWIG 4.4.1,
Clang 17, FastDDS 3.4.0.
Signed-off-by: Tuguberk <akbulut.tugberk@gmail.com>1 parent f35b320 commit 5dbfaf2
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
| 55 | + | |
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| |||
0 commit comments