]> gitweb.factorcode.org Git - factor.git/commitdiff
os-unix.hpp: Use the old strerror_r insetad of the newfangled one.
authorDoug Coleman <doug.coleman@gmail.com>
Thu, 17 Jul 2014 00:08:02 +0000 (17:08 -0700)
committerDoug Coleman <doug.coleman@gmail.com>
Thu, 17 Jul 2014 00:08:02 +0000 (17:08 -0700)
vm/os-unix.hpp

index ca3bd3bd66e21e5158eb7128080a519038e6c390..a08711dc447046b20f1844a60e85868f247f8449 100644 (file)
@@ -31,6 +31,14 @@ typedef char symbol_char;
 
 #define OPEN_READ(path) fopen(path, "rb")
 #define OPEN_WRITE(path) fopen(path, "wb")
+
+#ifdef _GNU_SOURCE
+extern "C" {
+  extern int __xpg_strerror_r (int __errnum, char *__buf, size_t __buflen) __THROW __nonnull ((2));
+}
+#define strerror_r __xpg_strerror_r
+#endif
+
 #define THREADSAFE_STRERROR(errnum, buf, buflen) strerror_r(errnum, buf, buflen)
 
 #define print_native_string(string) print_string(string)