Skip to content

Add char_traits<uint8_t> #1820

New issue

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

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

Already on GitHub? # to your account

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

Conversation

placintaalexandru
Copy link

@placintaalexandru placintaalexandru commented Apr 10, 2025

Fixes 1812

char_traits<uint8_t> type was not supplied

@placintaalexandru
Copy link
Author

@microsoft-github-policy-service agree

@placintaalexandru placintaalexandru force-pushed the fix/Build-on-recent-libc++ branch from 0bcfaff to 396259a Compare April 10, 2025 14:37
aminya added a commit to aminya/vcpkg that referenced this pull request May 5, 2025
Cpprestsdk fails to compile on newer MacOS due to missing char_traits.

This provides the fix from microsoft/cpprestsdk#1820
Related to microsoft/cpprestsdk#1812
aminya added a commit to aminya/vcpkg that referenced this pull request May 5, 2025
Cpprestsdk fails to compile on newer MacOS due to missing char_traits.

This provides the fix from microsoft/cpprestsdk#1820
Related to microsoft/cpprestsdk#1812
aminya added a commit to aminya/vcpkg that referenced this pull request May 5, 2025
Cpprestsdk fails to compile on newer MacOS due to missing char_traits.

This provides the fix from microsoft/cpprestsdk#1820
Related to microsoft/cpprestsdk#1812
aminya added a commit to aminya/vcpkg that referenced this pull request May 5, 2025
Cpprestsdk fails to compile on newer MacOS due to missing char_traits.

This provides the fix from microsoft/cpprestsdk#1820
Related to microsoft/cpprestsdk#1812
@BillyONeal
Copy link
Member

This PR introduces undefined behavior: https://eel.is/c++draft/requirements#namespace.std-2

There is no program-defined type here. This also fails if 2 libraries try to do this.

Copy link

@aminya aminya left a comment

Choose a reason for hiding this comment

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

The definition needs to be guarded

@@ -0,0 +1,74 @@
#include <cstdint>
Copy link

Choose a reason for hiding this comment

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

Suggested change
#include <cstdint>
#pragma once
#include <cstddef>
#if (_LIBCPP_VERSION >= 190000)
#include <cstdint>


static int_type eof() noexcept { return static_cast<int_type>(-1); }
};
} // namespace std
Copy link

Choose a reason for hiding this comment

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

Suggested change
} // namespace std
} // namespace std
#endif // (_LIBCPP_VERSION >= 190000)

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fails to build on recent libc++ (20 tested)
3 participants