Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix undeclared for edians #949

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

woensug-choi
Copy link

When compiling mavlink in navtive install of ROS2 Humble in Mac OS X (Sonoma 14.5) with Apple Silicon (M3),

Had to add translation definitions for macos

#elif __APPLE__
#include <machine/endian.h>
#include <libkern/OSByteOrder.h>
#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)

To fix following compile error

/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);

/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);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant