Skip to content

Add a patch in rviz_ogre_vendor to build with clang on macOS #1510

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

Draft
wants to merge 1 commit into
base: rolling
Choose a base branch
from

Conversation

Yadunund
Copy link
Member

Description

Tried building rviz_ogre_vendor and MacOS 15 (Sequoia) with XCode 16.x and build fails as the newer versions of (apple) clang on macOS is does not provide default implementations of std::char_traits for non-standard character types like unsigned short and unsigned int.

The PR adds a patch that provides explicit specializations for std::char_traits and std::char_traits. It defines all the necessary types and static member functions (like compare, length, copy, assign, etc.) that std::basic_string needs to operate on these character types.

Is this user-facing behavior change?

Yes

Did you use Generative AI?

Yes, patch file generated using Gemini Code Assist extension in VSCode.

Additional Information

@Yadunund Yadunund marked this pull request as draft June 27, 2025 21:13
#include <stdexcept>

+#if (OGRE_PLATFORM == OGRE_PLATFORM_APPLE || OGRE_PLATFORM == OGRE_PLATFORM_APPLE_IOS) && __clang_major__ >= 15
+#include <string>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

string is already included

+ static bool lt(const char_type& a, const char_type& b) { return a < b; }
+
+ static int compare(const char_type* s1, const char_type* s2, size_t n) {
+ for (size_t i = 0; i < n; ++i) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

include <cstddef>

+#endif
+
+#if (OGRE_PLATFORM == OGRE_PLATFORM_APPLE || OGRE_PLATFORM == OGRE_PLATFORM_APPLE_IOS) && __clang_major__ >= 15
+#include <string>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

include already included

+}
+#endif
+
+#if (OGRE_PLATFORM == OGRE_PLATFORM_APPLE || OGRE_PLATFORM == OGRE_PLATFORM_APPLE_IOS) && __clang_major__ >= 15
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the #if is the same as the upper one. Is this duplicated ?

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.

2 participants