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: deprecated use of std::char_traits<unsigned short>::length #791

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Clement-Devevey
Copy link

@Clement-Devevey Clement-Devevey commented Jan 20, 2025

Fix the warning about deprecated use of char_traits by char_traits<char16_t> as it has been discussing in this thread:
@codeinred Since we've decided to make C++11 a requirement for future versions of JavaCPP, let's just replace unsigned short with char16_t. Thanks!

Originally posted by @saudet in #753 (comment)

--
Original issue is;
warning: 'char_traits' is deprecated: char_traits for T not equal to char, wchar_t, char8_t, char16_t or char32_t is non-standard and is provided for a temporary period. It will be removed in LLVM 19, so please migrate off of it. [-Wdeprecated-declarations]

@codeinred Since we've decided to make C++11 a requirement for future versions of JavaCPP, let's just replace unsigned short with char16_t. Thanks!

_Originally posted by @saudet in bytedeco#753 (comment)

warning: 'char_traits<unsigned short>' is deprecated: char_traits<T> for T not equal to char, wchar_t, char8_t, char16_t or char32_t is non-standard and is provided for a temporary period. It will be removed in LLVM 19, so please migrate off of it. [-Wdeprecated-declarations]
@Clement-Devevey
Copy link
Author

Having one issue about doing this:
in JavaCPP_createStringFromUTF16 the return env->NewString(ptr, length); isn't working:
Cannot initialize a parameter of type 'const jchar *' (aka 'const unsigned short *') with an lvalue of type 'const char16_t *'

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.

1 participant