You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/05/21 22:05:25 UTC

[GitHub] [arrow] kou commented on a diff in pull request #13203: ARROW-16617: [C++] Add support for multi-byte system error message on Windows

kou commented on code in PR #13203:
URL: https://github.com/apache/arrow/pull/13203#discussion_r878765662


##########
cpp/src/arrow/util/io_util.cc:
##########
@@ -203,16 +203,26 @@ std::string ErrnoMessage(int errnum) { return std::strerror(errnum); }
 
 #if _WIN32
 std::string WinErrorMessage(int errnum) {
-  char buf[1024];
-  auto nchars = FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
-                               NULL, errnum, 0, buf, sizeof(buf), NULL);
-  if (nchars == 0) {
+#define MAX_N_CHARACTERS 1024
+#define MAX_N_UTF8_BYTES 4096

Review Comment:
   Yes. I should have used `constexpr`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org