From 28542b14c4df40c7a54bfcf65d7c725bd99fb3e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ingo=20Kl=C3=B6cker?= Date: Thu, 4 Jul 2024 18:03:17 +0200 Subject: cpp: Deprecate Error::asString and update users * lang/cpp/src/error.h (Error::asString): Mark as deprecated. * lang/cpp/src/context.cpp (operator<<), lang/cpp/src/editinteractor.cpp (edit_interactor_callback_impl), lang/cpp/tests/run-getkey.cpp (main), lang/cpp/tests/run-keylist.cpp (main), lang/cpp/tests/run-wkdlookup.cpp (main): Use Error::asStdString instead of Error::asString. -- GnuPG-bug-id: 7188 --- lang/cpp/src/error.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lang/cpp/src/error.h') diff --git a/lang/cpp/src/error.h b/lang/cpp/src/error.h index bc970e36..000b562b 100644 --- a/lang/cpp/src/error.h +++ b/lang/cpp/src/error.h @@ -47,7 +47,10 @@ public: explicit Error(unsigned int e) : mErr(e), mMessage() {} const char *source() const; - const char *asString() const; + /* This function is deprecated. Use asStdString() instead. asString() may + * return wrongly encoded (i.e. not UTF-8) results on Windows for the main + * thread if the function was first called from a secondary thread. */ + GPGMEPP_DEPRECATED const char *asString() const; std::string asStdString() const; int code() const; -- cgit v1.2.3