From 0981cc089ea88f146a6c949146e73f88c1b295e9 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Wed, 24 Jul 2013 21:53:30 +0300 Subject: Fix compiling on MinGW. --- extension/gawkdirfd.h | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'extension/gawkdirfd.h') diff --git a/extension/gawkdirfd.h b/extension/gawkdirfd.h index 52b91804..4710dab4 100644 --- a/extension/gawkdirfd.h +++ b/extension/gawkdirfd.h @@ -25,6 +25,16 @@ # define ENOTSUP ENOSYS #endif +/* + * This is for fake directory file descriptors on systems that don't + * allow to open() a directory. + * + * It would be nice if this could be shared with the definition in awk.h + * in the main code base, but there's not a very clean way to do that, + * at least that I can see. + */ +#define FAKE_FD_VALUE 42 + #ifndef DIR_TO_FD # define DIR_TO_FD(d) (FAKE_FD_VALUE) #endif @@ -39,7 +49,3 @@ dirfd (DIR *dir_p) return fd; } #endif /* HAVE_DIRFD */ - -/* This is for fake directory file descriptors on systems that don't - allow to open() a directory. */ -#define FAKE_FD_VALUE 42 -- cgit v1.2.3 From 844e16cea1ffe0e02b5b727fd8960271d1842020 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Tue, 20 Aug 2013 21:18:51 +0300 Subject: Move FAKE_FD_VALUE to shared header. --- extension/gawkdirfd.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'extension/gawkdirfd.h') diff --git a/extension/gawkdirfd.h b/extension/gawkdirfd.h index 4710dab4..a3a2b6a6 100644 --- a/extension/gawkdirfd.h +++ b/extension/gawkdirfd.h @@ -29,11 +29,13 @@ * This is for fake directory file descriptors on systems that don't * allow to open() a directory. * - * It would be nice if this could be shared with the definition in awk.h - * in the main code base, but there's not a very clean way to do that, - * at least that I can see. + * Including a header from the main gawk source to share the definition + * of FAKE_FD_VALUE is the least of all evils that I can see. + * + * Unlike the main gawk code base, this include is NOT dependant + * upon MinGW or EMX. */ -#define FAKE_FD_VALUE 42 +#include "../nonposix.h" #ifndef DIR_TO_FD # define DIR_TO_FD(d) (FAKE_FD_VALUE) -- cgit v1.2.3