I have something like this which works on 4.18, but not on 4.19:
#define CRYPTO_UNKNOWN_ERROR "RCrypto: unknown error!"
.
.
.
catch (const std::exception& ex) {
#if defined ( _WIN32 ) || defined ( _WIN64 )
MessageBoxA(0, ex.what(), "Cryptography Error", MB_OK);
#endif /* defined ( _WIN32 ) || defined ( _WIN64 ) */
checkf(false, UTF8_TO_TCHAR(ex.what()));
}
catch (...) {
#if defined ( _WIN32 ) || defined ( _WIN64 )
MessageBoxA(0, CRYPTO_UNKNOWN_ERROR, "Cryptography Error", MB_OK);
#endif /* defined ( _WIN32 ) || defined ( _WIN64 ) */
checkf(false, UTF8_TO_TCHAR(CRYPTO_UNKNOWN_ERROR));
}
And here is the error with both checkfs:
Runtime/Core/Public/Misc/AssertionMacros.h:50:3: error: static_assert failed "Formatting string must be a TCHAR array."
static_assert(TIsArrayOrRefOfType<FmtType, TCHAR>::Value, "Formatting string must be a TCHAR array.");
Looking at UTF8_TO_TCHAR definition, I assume it should return a TCHAR* as expected:
#define UTF8_TO_TCHAR(str) (TCHAR*)FUTF8ToTCHAR((const ANSICHAR*)str).Get()