summaryrefslogtreecommitdiff
path: root/lib/getcwd.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2003-03-06 22:23:26 +0000
committerJim Meyering <jim@meyering.net>2003-03-06 22:23:26 +0000
commitb4e7a90ce6848d9cf0f6da4ea51912333b9cfc29 (patch)
tree8b897ece1daa69bfa6a1eed3ff9f05b8a6a42b23 /lib/getcwd.c
parent08e9a37430ca54cf46aaf005478fc05e1d31516c (diff)
downloadcoreutils-b4e7a90ce6848d9cf0f6da4ea51912333b9cfc29.tar.xz
#undef getcwd before including system headers.
This avoid a build failure on IRIX 6.5. Reported by Nelson Beebe.
Diffstat (limited to 'lib/getcwd.c')
-rw-r--r--lib/getcwd.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/lib/getcwd.c b/lib/getcwd.c
index 26fea6ff6..e3a73f0ce 100644
--- a/lib/getcwd.c
+++ b/lib/getcwd.c
@@ -19,6 +19,10 @@
#include <config.h>
+/* Undefine getcwd here so any prototype is not redefined to be a
+ prototype for rpl_getcwd. */
+#undef getcwd
+
#include <stdlib.h>
#include <string.h>
@@ -32,14 +36,6 @@ extern int errno;
#include "pathmax.h"
#include "same.h"
-/* Undefine getcwd here so any prototype is not redefined to be a
- prototype for rpl_getcwd. */
-#undef getcwd
-
-#if !HAVE_DECL_GETCWD
-extern char *getcwd (char *, size_t);
-#endif
-
/* Guess high, because that makes the test below more conservative.
But this is a kludge, because we should really use
pathconf (".", _PC_NAME_MAX). But it's probably not worth the cost. */