diff options
author | Ries van Twisk <github@rvt.dds.nl> | 2019-12-30 12:12:22 +0100 |
---|---|---|
committer | Ries van Twisk <github@rvt.dds.nl> | 2019-12-30 12:12:22 +0100 |
commit | 859d5585090d966a222da6bc4f14f0d749d13277 (patch) | |
tree | 0d32e371dd1af95758cd0f9b0cff775cc687fd84 /tracker-freepie-udp | |
parent | c537acf6d7ebff26db9d5981d33d05fe7101baf6 (diff) |
FreePIE Use packed struct with clang to receive datagram
Diffstat (limited to 'tracker-freepie-udp')
-rw-r--r-- | tracker-freepie-udp/ftnoir_tracker_freepie-udp.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/tracker-freepie-udp/ftnoir_tracker_freepie-udp.cpp b/tracker-freepie-udp/ftnoir_tracker_freepie-udp.cpp index 6622a3b7..8c4d7c47 100644 --- a/tracker-freepie-udp/ftnoir_tracker_freepie-udp.cpp +++ b/tracker-freepie-udp/ftnoir_tracker_freepie-udp.cpp @@ -17,13 +17,21 @@ tracker_freepie::~tracker_freepie() } void tracker_freepie::run() { -#pragma pack(push, 1) - struct { +#ifdef __clang__ + struct __attribute__((packed)) { uint8_t pad1; uint8_t flags; float fl[12]; - } data {}; -#pragma pack(pop) + } data {}; +#else + #pragma pack(push, 1) + struct { + uint8_t pad1; + uint8_t flags; + float fl[12]; + } data {}; + #pragma pack(pop) +#endif enum F { |