Skip to content

Commit

Permalink
Fix windows build (#290)
Browse files Browse the repository at this point in the history
* Remove 'static inline' declaration incompatible with older VS toolchains
* Use _snprintf instead of snprintf on MS toolchain versions prior to VS2015
  • Loading branch information
rndi authored Feb 27, 2018
1 parent 7ddab84 commit 5e0f2f8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion srtcore/srt_compat.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,14 @@ written by
#endif


static inline const char* SysStrError_Fallback(int errnum, char* buf, size_t buflen)
static const char* SysStrError_Fallback(int errnum, char* buf, size_t buflen)
{
#if defined(_MSC_VER) && _MSC_VER < 1900
_snprintf(buf, buflen - 1, "ERROR CODE %d", errnum);
buf[buflen - 1] = '\0';
#else
snprintf(buf, buflen, "ERROR CODE %d", errnum);
#endif
return buf;
}

Expand Down

0 comments on commit 5e0f2f8

Please sign in to comment.