Skip to content

Commit 61a70c5

Browse files
committed
fix: resolve deprecated-declarations warnings with gcc15
1 parent 8dce385 commit 61a70c5

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

common/common.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -706,11 +706,17 @@ bool fs_validate_filename(const std::string & filename) {
706706
// disable C++17 deprecation warning for std::codecvt_utf8
707707
# pragma clang diagnostic push
708708
# pragma clang diagnostic ignored "-Wdeprecated-declarations"
709+
#elif defined(__GNUC__)
710+
# pragma GCC diagnostic push
711+
# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
709712
#endif
713+
710714
std::wstring_convert<std::codecvt_utf8<char32_t>, char32_t> converter;
711715

712716
#if defined(__clang__)
713717
# pragma clang diagnostic pop
718+
#elif defined(__GNUC__)
719+
# pragma GCC diagnostic pop
714720
#endif
715721

716722
filename_utf32 = converter.from_bytes(filename);

src/unicode.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,12 +204,17 @@ static inline std::wstring unicode_wstring_from_utf8(const std::string & s) {
204204
// disable C++17 deprecation warning for std::codecvt_utf8
205205
# pragma clang diagnostic push
206206
# pragma clang diagnostic ignored "-Wdeprecated-declarations"
207+
#elif defined(__GNUC__)
208+
# pragma GCC diagnostic push
209+
# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
207210
#endif
208211

209212
std::wstring_convert<std::codecvt_utf8<wchar_t>> conv;
210213

211214
#if defined(__clang__)
212215
# pragma clang diagnostic pop
216+
#elif defined(__GNUC__)
217+
# pragma GCC diagnostic pop
213218
#endif
214219

215220
return conv.from_bytes(s);

0 commit comments

Comments
 (0)