Please look at amkozlov/raxml-ng#138.
Under MinGW errno is defined in errno.h in the following way:
[...]
#ifndef _CRT_ERRNO_DEFINED
#define _CRT_ERRNO_DEFINED
_CRTIMP extern int *__cdecl _errno(void);
#define errno (*_errno())
errno_t __cdecl _set_errno(int _Value);
errno_t __cdecl _get_errno(int *_Value);
#endif /* _CRT_ERRNO_DEFINED */
[...]
Therefore, as shown in the original report, there is a name clash during compilation.
Here is the patch:
diff --git a/src/pllmod_common.c b/src/pllmod_common.c
index ff8979a..45f9e3f 100644
--- a/src/pllmod_common.c
+++ b/src/pllmod_common.c
@@ -39,9 +39,9 @@
* @param[in] errmsg_fmt formatted error message
*/
__attribute__((format(printf, 2, 3)))
-void pllmod_set_error(int errno, const char* errmsg_fmt, ...)
+void pllmod_set_error(int errcode, const char* errmsg_fmt, ...)
{
- pll_errno = errno;
+ pll_errno = errcode;
va_list args;
va_start(args, errmsg_fmt);
diff --git a/src/pllmod_common.h b/src/pllmod_common.h
index 9d51ad5..19374c2 100644
--- a/src/pllmod_common.h
+++ b/src/pllmod_common.h
@@ -40,7 +40,7 @@
#define PLLMOD_ERROR_INVALID_INDEX 1003
#define PLLMOD_ERROR_NOT_IMPLEMENTED 1004
-void pllmod_set_error(int errno, const char* errmsg_fmt, ...);
+void pllmod_set_error(int errcode, const char* errmsg_fmt, ...);
void pllmod_reset_error();
#endif
Please look at amkozlov/raxml-ng#138.
Under MinGW
errnois defined inerrno.hin the following way:Therefore, as shown in the original report, there is a name clash during compilation.
Here is the patch: