mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-07-24 01:27:19 +03:00
Add support for Mingw
This commit is contained in:
parent
a8f8d7540d
commit
a19e87fbad
12 changed files with 357 additions and 71 deletions
|
|
@ -67,7 +67,12 @@ void (*je_malloc_message)(void *, const char *s)
|
|||
int
|
||||
buferror(int errnum, char *buf, size_t buflen)
|
||||
{
|
||||
#ifdef _GNU_SOURCE
|
||||
|
||||
#ifdef _WIN32
|
||||
FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM, NULL, GetLastError(), 0,
|
||||
(LPSTR)buf, buflen, NULL);
|
||||
return (0);
|
||||
#elif defined(_GNU_SOURCE)
|
||||
char *b = strerror_r(errno, buf, buflen);
|
||||
if (b != buf) {
|
||||
strncpy(buf, b, buflen);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue