From 4879008806f5e32ac01fccf4042087229fb63121 Mon Sep 17 00:00:00 2001 From: CHOI WOEN-SUG Date: Fri, 14 Jun 2024 00:27:17 +0900 Subject: [PATCH] fix undeclared for edians /test_ws/install/include/mavlink/v2.0/common/../msgmap.hpp:114:12: error: use of undeclared identifier 'htole16' return htole16(data); ^ /test_ws/install/include/mavlink/v2.0/common/../msgmap.hpp:120:12: error: use of undeclared identifier 'htole32' return htole32(data); ^ /test_ws/install/include/mavlink/v2.0/common/../msgmap.hpp:126:12: error: use of undeclared identifier 'htole64' return htole64(data); ^ /install/include/mavlink/v2.0/common/../msgmap.hpp:156:12: error: use of undeclared identifier 'le16toh' return le16toh(data); ^ /install/include/mavlink/v2.0/common/../msgmap.hpp:162:12: error: use of undeclared identifier 'le32toh' return le32toh(data); ^ /install/include/mavlink/v2.0/common/../msgmap.hpp:168:12: error: use of undeclared identifier 'le64toh' return le64toh(data); --- generator/CPP11/include_v2.0/msgmap.hpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/generator/CPP11/include_v2.0/msgmap.hpp b/generator/CPP11/include_v2.0/msgmap.hpp index a3956aa20..b4787b84a 100644 --- a/generator/CPP11/include_v2.0/msgmap.hpp +++ b/generator/CPP11/include_v2.0/msgmap.hpp @@ -6,6 +6,13 @@ #include #elif __APPLE__ #include +#include +#define htole16(x) OSSwapHostToLittleInt16(x) +#define le16toh(x) OSSwapLittleToHostInt16(x) +#define htole32(x) OSSwapHostToLittleInt32(x) +#define le32toh(x) OSSwapLittleToHostInt32(x) +#define htole64(x) OSSwapHostToLittleInt64(x) +#define le64toh(x) OSSwapLittleToHostInt64(x) #else #include #endif