From a5e47313f9b8cf35a4968e8739181448d4ebcd8f Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Fri, 14 Jun 2019 17:05:25 +0200 Subject: [PATCH] Allow null error messages in exceptions Signed-off-by: Simon Rozman --- include/WinStd/COM.h | 2 +- include/WinStd/Common.h | 6 +++--- include/WinStd/EAP.h | 2 +- include/WinStd/Sec.h | 2 +- include/WinStd/WinSock2.h | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/WinStd/COM.h b/include/WinStd/COM.h index fd809c70..eeec0511 100644 --- a/include/WinStd/COM.h +++ b/include/WinStd/COM.h @@ -75,7 +75,7 @@ namespace winstd /// \param[in] num COM error code /// \param[in] msg Error message /// - inline com_runtime_error(_In_ error_type num, _In_z_ const char *msg) : num_runtime_error(num, msg) + inline com_runtime_error(_In_ error_type num, _In_opt_z_ const char *msg = nullptr) : num_runtime_error(num, msg) { } diff --git a/include/WinStd/Common.h b/include/WinStd/Common.h index 69a2192a..3386e49e 100644 --- a/include/WinStd/Common.h +++ b/include/WinStd/Common.h @@ -1498,7 +1498,7 @@ namespace winstd /// \param[in] num Numeric error code /// \param[in] msg Error message /// - inline num_runtime_error(_In_ error_type num, _In_z_ const char *msg) : + inline num_runtime_error(_In_ error_type num, _In_opt_z_ const char *msg = nullptr) : m_num(num), runtime_error(msg) { @@ -1569,7 +1569,7 @@ namespace winstd /// \param[in] num Windows error code /// \param[in] msg Error message /// - inline win_runtime_error(_In_ error_type num, _In_z_ const char *msg) : num_runtime_error(num, msg) + inline win_runtime_error(_In_ error_type num, _In_opt_z_ const char *msg = nullptr) : num_runtime_error(num, msg) { } @@ -1589,7 +1589,7 @@ namespace winstd /// /// \param[in] msg Error message /// - inline win_runtime_error(_In_z_ const char *msg) : num_runtime_error(GetLastError(), msg) + inline win_runtime_error(_In_opt_z_ const char *msg = nullptr) : num_runtime_error(GetLastError(), msg) { } diff --git a/include/WinStd/EAP.h b/include/WinStd/EAP.h index e83e0f9d..a61d4724 100644 --- a/include/WinStd/EAP.h +++ b/include/WinStd/EAP.h @@ -561,7 +561,7 @@ namespace winstd /// \param[in] err EapHost error descriptor /// \param[in] msg Error message /// - inline eap_runtime_error(_In_ const EAP_ERROR &err, _In_z_ const char *msg) : + inline eap_runtime_error(_In_ const EAP_ERROR &err, _In_opt_z_ const char *msg = nullptr) : m_type (err.type ), m_reason (err.dwReasonCode ), m_root_cause_id (err.rootCauseGuid ), diff --git a/include/WinStd/Sec.h b/include/WinStd/Sec.h index b6a9f74d..167092f2 100644 --- a/include/WinStd/Sec.h +++ b/include/WinStd/Sec.h @@ -333,7 +333,7 @@ namespace winstd /// \param[in] num Security provider error code /// \param[in] msg Error message /// - inline sec_runtime_error(_In_ error_type num, _In_z_ const char *msg) : num_runtime_error(num, msg) + inline sec_runtime_error(_In_ error_type num, _In_opt_z_ const char *msg = nullptr) : num_runtime_error(num, msg) { } diff --git a/include/WinStd/WinSock2.h b/include/WinStd/WinSock2.h index 35685c4e..2c37b78b 100644 --- a/include/WinStd/WinSock2.h +++ b/include/WinStd/WinSock2.h @@ -68,7 +68,7 @@ namespace winstd /// \param[in] num WinSock2 error code /// \param[in] msg Error message /// - inline ws2_runtime_error(_In_ error_type num, _In_z_ const char *msg) : num_runtime_error(num, msg) + inline ws2_runtime_error(_In_ error_type num, _In_opt_z_ const char *msg = nullptr) : num_runtime_error(num, msg) { } @@ -88,7 +88,7 @@ namespace winstd /// /// \param[in] msg Error message /// - inline ws2_runtime_error(_In_z_ const char *msg) : num_runtime_error(WSAGetLastError(), msg) + inline ws2_runtime_error(_In_opt_z_ const char *msg = nullptr) : num_runtime_error(WSAGetLastError(), msg) { }