libctf: compilation failure on MinGW due to missing errno values
authorEli Zaretskii <eliz@gnu.org>
Sun, 26 Jul 2020 23:06:02 +0000 (16:06 -0700)
committerJoel Brobecker <brobecker@adacore.com>
Sun, 26 Jul 2020 23:11:36 +0000 (16:11 -0700)
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)

libctf/ChangeLog
libctf/ctf-create.c
libctf/ctf-subr.c

index 6887c3ff869ab24a96c25c0a0fd28fc0ad6e2928..bbd807dddfd2ae5322fb1bba9fa27fa52a79c8d4 100644 (file)
@@ -1,3 +1,10 @@
+2020-07-26  Eli Zaretskii  <eliz@gnu.org>
+
+       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  <nick.alcock@oracle.com>
 
        * ctf-create.c (ctf_dtd_insert): Add uintptr_t casts.
index ee8757549feb6f2cd528d682c13e6f07f4c29e1e..b319476c168b34c66364414776ac5a5dcc45291b 100644 (file)
 #include <unistd.h>
 #include <zlib.h>
 
+#ifndef EOVERFLOW
+#define EOVERFLOW ERANGE
+#endif
+
 #ifndef roundup
 #define roundup(x, y)  ((((x) + ((y) - 1)) / (y)) * (y))
 #endif
index 455f18dcffbbd20e9f1b8f1da89177494997b40b..15865706437b5b3ec331383a075aae527dcefd68 100644 (file)
 #include <string.h>
 #include <unistd.h>
 
+#ifndef ENOTSUP
+#define ENOTSUP ENOSYS
+#endif
+
 int _libctf_version = CTF_VERSION;           /* Library client version.  */
 int _libctf_debug = 0;                       /* Debugging messages enabled.  */
 
This page took 0.02841 seconds and 4 git commands to generate.