From: Eli Zaretskii Date: Sun, 26 Jul 2020 23:06:02 +0000 (-0700) Subject: libctf: compilation failure on MinGW due to missing errno values X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=555adca2e3bcabdef58abf2f68291e47479bc09d;p=binutils-gdb.git libctf: compilation failure on MinGW due to missing errno values This commit fixes a compilation failure in a couple of libctf files due to the use of EOVERFLOW and ENOTSUP, which are not defined when compiling on MinGW. libctf/ChangeLog: PR binutils/25155: * ctf-create.c (EOVERFLOW): If not defined by system header, redirect to ERANGE as a poor man's substitute. * ctf-subr.c (ENOTSUP): If not defined, use ENOSYS instead. (cherry picked from commit 50500ecfefd6acc4c7f6c2a95bc0ae1945103220) --- diff --git a/libctf/ChangeLog b/libctf/ChangeLog index 6887c3ff869..bbd807dddfd 100644 --- a/libctf/ChangeLog +++ b/libctf/ChangeLog @@ -1,3 +1,10 @@ +2020-07-26 Eli Zaretskii + + PR binutils/25155: + * ctf-create.c (EOVERFLOW): If not defined by system header, + redirect to ERANGE as a poor man's substitute. + * ctf-subr.c (ENOTSUP): If not defined, use ENOSYS instead. + 2020-07-22 Nick Alcock * ctf-create.c (ctf_dtd_insert): Add uintptr_t casts. diff --git a/libctf/ctf-create.c b/libctf/ctf-create.c index ee8757549fe..b319476c168 100644 --- a/libctf/ctf-create.c +++ b/libctf/ctf-create.c @@ -24,6 +24,10 @@ #include #include +#ifndef EOVERFLOW +#define EOVERFLOW ERANGE +#endif + #ifndef roundup #define roundup(x, y) ((((x) + ((y) - 1)) / (y)) * (y)) #endif diff --git a/libctf/ctf-subr.c b/libctf/ctf-subr.c index 455f18dcffb..15865706437 100644 --- a/libctf/ctf-subr.c +++ b/libctf/ctf-subr.c @@ -26,6 +26,10 @@ #include #include +#ifndef ENOTSUP +#define ENOTSUP ENOSYS +#endif + int _libctf_version = CTF_VERSION; /* Library client version. */ int _libctf_debug = 0; /* Debugging messages enabled. */