aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--extension/ChangeLog8
-rw-r--r--extension/gawkfts.c2
-rw-r--r--extension/gawkfts.h11
3 files changed, 20 insertions, 1 deletions
diff --git a/extension/ChangeLog b/extension/ChangeLog
index 70008f5a..fcc9d8a8 100644
--- a/extension/ChangeLog
+++ b/extension/ChangeLog
@@ -1,3 +1,11 @@
+2012-09-07 Akim Demaille <akim@lrde.epita.fr>
+
+ * extension/gawkfts.h (__THROW): Define if it is not.
+ Copied from getopt.h.
+ * extension/gawkfts.c (fts_alloc): Since FTSENT.fts_statp is
+ defined as a struct stat*, use that type for casts instead of
+ the undefined __fts_stat_t type.
+
2012-09-07 Arnold D. Robbins <arnold@skeeve.com>
* readdir.c, readdir.3am: Change argument to readdir_do_ftype()
diff --git a/extension/gawkfts.c b/extension/gawkfts.c
index f3a3cc0f..2f465959 100644
--- a/extension/gawkfts.c
+++ b/extension/gawkfts.c
@@ -1051,7 +1051,7 @@ fts_alloc(FTS *sp, const char *name, size_t namelen)
return (NULL);
if (!ISSET(FTS_NOSTAT))
- p->fts_statp = (__fts_stat_t *)ALIGN(
+ p->fts_statp = (struct stat *)ALIGN(
(unsigned long)(p->fts_name + namelen + 2));
#else
if ((p = malloc(sizeof(FTSENT) + namelen)) == NULL)
diff --git a/extension/gawkfts.h b/extension/gawkfts.h
index 7773b770..41109664 100644
--- a/extension/gawkfts.h
+++ b/extension/gawkfts.h
@@ -34,6 +34,17 @@
#ifndef _FTS_H_
#define _FTS_H_
+#ifndef __THROW
+# ifndef __GNUC_PREREQ
+# define __GNUC_PREREQ(maj, min) (0)
+# endif
+# if defined __cplusplus && __GNUC_PREREQ (2,8)
+# define __THROW throw ()
+# else
+# define __THROW
+# endif
+#endif
+
typedef struct {
struct _ftsent *fts_cur; /* current node */
struct _ftsent *fts_child; /* linked list of children */