1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

Upgrade libsrt to v1.5.3. v5.0.183 (#3808)

This commit is contained in:
winlin 2023-09-21 22:31:38 +08:00
parent 389a62ee3a
commit 632d457194
154 changed files with 39813 additions and 17038 deletions

View file

@ -16,12 +16,14 @@ written by
// Prevents from misconfiguration through preprocessor.
#include "platform_sys.h"
#include <srt_compat.h>
#include <string.h>
#include <stdio.h>
#include <errno.h>
#if defined(__unix__) && !defined(BSD)
#if defined(__unix__) && !defined(BSD) && !defined(SUNOS)
#include <features.h>
#endif
@ -68,7 +70,7 @@ extern const char * SysStrError(int errnum, char * buf, size_t buflen)
// your compilation fails when you use wide characters.
// The problem is that when TCHAR != char, then the buffer written this way
// would have to be converted to ASCII, not just copied by strncpy.
FormatMessage(0
FormatMessageA(0
| FORMAT_MESSAGE_ALLOCATE_BUFFER
| FORMAT_MESSAGE_FROM_SYSTEM
| FORMAT_MESSAGE_IGNORE_INSERTS,
@ -85,8 +87,12 @@ extern const char * SysStrError(int errnum, char * buf, size_t buflen)
if (lpMsgBuf)
{
#ifdef _MSC_VER
strncpy_s(buf, buflen, lpMsgBuf, _TRUNCATE);
#else
strncpy(buf, lpMsgBuf, buflen-1);
buf[buflen-1] = 0;
#endif
LocalFree((HLOCAL)lpMsgBuf);
}
else