eina_error: On Windows strerror_s() is the same than POSIX strerror_r()

Summary: strerror_r() does not exist on Windows, but strerror_s() does

Test Plan: compilation

Reviewers: cedric, bu5hm4n, zmike

Reviewed By: zmike

Subscribers: zmike, bu5hm4n, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8279
This commit is contained in:
Vincent Torri 2019-03-13 09:53:17 -04:00 committed by Mike Blumenkrantz
parent f60fef6f0f
commit 12e0ee8742
1 changed files with 12 additions and 4 deletions

View File

@ -25,10 +25,6 @@
#include <stdlib.h>
#include <stdint.h>
#ifdef _WIN32
# include <Evil.h>
#endif
#include "eina_config.h"
#include "eina_private.h"
@ -111,6 +107,18 @@ _eina_error_msg_alloc(void)
return _eina_errors + idx;
}
#ifdef _WIN32
# define HAVE_STRERROR_R
# ifdef STRERROR_R_CHAR_P
# undef STRERROR_R_CHAR_P
# endif
/* Windows has strerror_s(), similar to POSIX strerror_r() */
static inline int strerror_r(int errnum, char *buf, size_t buflen)
{
return strerror_s(buf, buflen, errnum);
}
#endif
/**
* @endcond
*/