Skip to content

Conversation

@artcore-c
Copy link

Adds guards for char16_t definition to prevent conflicts with system headers. Maintains backward compatibility for all platforms.

Description

Fix Summary

Prevents char16_t redefinition conflicts on platforms where it's already defined (notably macOS).

Technical Details

  • Adds comprehensive preprocessor checks:
    #if !defined(__CHAR16_TYPE__) && !defined(_CHAR16_T) && !defined(char16_t)
    

Adds guards for char16_t definition to prevent conflicts with system headers.
Maintains backward compatibility for all platforms.
Copy link

@fujitatomoya fujitatomoya left a comment

Choose a reason for hiding this comment

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

this fixes a compatibility issue by ensuring that char16_t is only typedef'd in C but in C++ (where it is a built-in type). This prevents potential compilation errors when including this header in C++ code.

Signed-off-by: artcore-c <[email protected]>
@@ -0,0 +1,12 @@
--- a/rosidl_dynamic_typesupport/include/rosidl_dynamic_typesupport/uchar.h
Copy link

Choose a reason for hiding this comment

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

is this file used somewhere ?

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.

3 participants