From bc961afdda311acb66099bf4ceb86f805dde9efb Mon Sep 17 00:00:00 2001
From: Ray Donnelly <mingw.android@gmail.com>
Date: Wed, 17 Feb 2021 16:39:31 +0100
Subject: [PATCH 4/7] live555 formatmessage

---
 BasicUsageEnvironment/BasicUsageEnvironment0.cpp | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/BasicUsageEnvironment/BasicUsageEnvironment0.cpp b/BasicUsageEnvironment/BasicUsageEnvironment0.cpp
index 2bc5a56..f094a8b 100644
--- a/BasicUsageEnvironment/BasicUsageEnvironment0.cpp
+++ b/BasicUsageEnvironment/BasicUsageEnvironment0.cpp
@@ -19,9 +19,6 @@ along with this library; if not, write to the Free Software Foundation, Inc.,
 
 #include "BasicUsageEnvironment0.hh"
 #include <stdio.h>
-#if defined(__WIN32__) || defined(_WIN32) || defined(_WIN32_WCE)
-#define snprintf _snprintf
-#endif
 
 
 ////////// BasicUsageEnvironment //////////
@@ -68,7 +65,6 @@ void BasicUsageEnvironment0::setResultErrMsg(MsgString msg, int err) {
 
   if (err == 0) err = getErrno();
 #if defined(__WIN32__) || defined(_WIN32) || defined(_WIN32_WCE)
-#ifndef _UNICODE
   char errMsg[RESULT_MSG_BUFFER_MAX] = "\0";
   if (0 != FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM, NULL, err, 0, errMsg, sizeof(errMsg)/sizeof(errMsg[0]), NULL)) {
     // Remove all trailing '\r', '\n' and '.'
@@ -76,9 +72,8 @@ void BasicUsageEnvironment0::setResultErrMsg(MsgString msg, int err) {
       *p = '\0';
     }
   } else
-    snprintf(errMsg, sizeof(errMsg)/sizeof(errMsg[0]), "error %d", err);
+    _snprintf(errMsg, sizeof(errMsg)/sizeof(errMsg[0]), "error %d", err);
   appendToResultMsg(errMsg);
-#endif
 #else
   appendToResultMsg(strerror(err));
 #endif
-- 
2.30.1.windows.1

