summaryrefslogtreecommitdiff
path: root/libguile/filesys.c
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2008-09-10 22:27:30 +0200
committerLudovic Courtès <ludo@gnu.org>2008-09-10 22:27:30 +0200
commit35a9197ccc91a3663313e1bf7d369101754a1075 (patch)
tree0389f04f4267d26b70c8e8cd54329be28ccf438b /libguile/filesys.c
parente7bca22779c68b800c75fdad8841440dfeb32f8d (diff)
parentf30e1bdf97ae8b2b2918da585f887a4d3a23a347 (diff)
downloadguile-35a9197ccc91a3663313e1bf7d369101754a1075.tar.gz
Merge commit 'f30e1bdf97ae8b2b2918da585f887a4d3a23a347' into boehm-demers-weiser-gc
Conflicts: libguile/Makefile.am libguile/coop-pthreads.c libguile/gc-freelist.c libguile/gc-segment.c libguile/gc.c libguile/private-gc.h test-suite/tests/environments.nottest
Diffstat (limited to 'libguile/filesys.c')
-rw-r--r--libguile/filesys.c44
1 files changed, 23 insertions, 21 deletions
diff --git a/libguile/filesys.c b/libguile/filesys.c
index 8ac6bd246..72b45e92a 100644
--- a/libguile/filesys.c
+++ b/libguile/filesys.c
@@ -29,24 +29,22 @@
# include <config.h>
#endif
-/* AIX requires this to be the first thing in the file. The #pragma
- directive is indented so pre-ANSI compilers will ignore it, rather
- than choke on it. */
-#ifndef __GNUC__
-# if HAVE_ALLOCA_H
-# include <alloca.h>
-# else
-# ifdef _AIX
-# pragma alloca
-# else
-# ifndef alloca /* predefined by HP cc +Olibcalls */
-char *alloca ();
-# endif
-# endif
+/* This blob per the Autoconf manual (under "Particular Functions"). */
+#if HAVE_ALLOCA_H
+# include <alloca.h>
+#elif defined __GNUC__
+# define alloca __builtin_alloca
+#elif defined _AIX
+# define alloca __alloca
+#elif defined _MSC_VER
+# include <malloc.h>
+# define alloca _alloca
+#else
+# include <stddef.h>
+# ifdef __cplusplus
+extern "C"
# endif
-#endif
-#if HAVE_MALLOC_H
-#include <malloc.h> /* alloca on mingw, though its not used on that system */
+void *alloca (size_t);
#endif
#include <stdio.h>
@@ -202,10 +200,14 @@ char *alloca ();
# define fchmod(fd, mode) (-1)
#endif /* __MINGW32__ */
-/* This definition is for Solaris 10, it's probably not right elsewhere, but
- that's ok, it shouldn't be used elsewhere. */
-#if ! HAVE_DIRFD
-#define dirfd(dirstream) (dirstream->dd_fd)
+/* dirfd() returns the file descriptor underlying a "DIR*" directory stream.
+ Found on MacOS X for instance. The following definition is for Solaris
+ 10, it's probably not right elsewhere, but that's ok, it shouldn't be
+ used elsewhere. Crib note: If we need more then gnulib has a dirfd.m4
+ figuring out how to get the fd (dirfd function, dirfd macro, dd_fd field,
+ or d_fd field). */
+#ifndef dirfd
+#define dirfd(dirstream) ((dirstream)->dd_fd)
#endif