From b524848350bded2a8a05673b679dc707eae378b4 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Tue, 22 Jan 2013 20:45:40 +0200 Subject: Improve portability. --- extension/ChangeLog | 5 +++++ extension/gawkfts.c | 4 ++++ extension/inplace.c | 4 ++++ 3 files changed, 13 insertions(+) diff --git a/extension/ChangeLog b/extension/ChangeLog index 2c736992..5b364ac1 100644 --- a/extension/ChangeLog +++ b/extension/ChangeLog @@ -1,3 +1,8 @@ +2013-01-22 Arnold D. Robbins + + * gawkfts.c (S_ISREG): Define macro if not defined. Portability. + * inplace.c (S_ISREG): Ditto. + 2013-01-18 Arnold D. Robbins * readfile.c (do_readfile): Free `text' if read fails. Thanks to diff --git a/extension/gawkfts.c b/extension/gawkfts.c index 2b47275b..1ef98790 100644 --- a/extension/gawkfts.c +++ b/extension/gawkfts.c @@ -57,6 +57,10 @@ static char sccsid[] = "@(#)fts.c 8.6 (Berkeley) 8/14/94"; #include #include +#if ! defined(S_ISREG) && defined(S_IFREG) +#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) +#endif + /* #if ! HAVE_NBTOOL_CONFIG_H #define HAVE_STRUCT_DIRENT_D_NAMLEN diff --git a/extension/inplace.c b/extension/inplace.c index 20682ea5..e09f9000 100644 --- a/extension/inplace.c +++ b/extension/inplace.c @@ -44,6 +44,10 @@ #define _(msgid) gettext(msgid) #define N_(msgid) msgid +#if ! defined(S_ISREG) && defined(S_IFREG) +#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) +#endif + static const gawk_api_t *api; /* for convenience macros to work */ static awk_ext_id_t *ext_id; static const char *ext_version = "inplace extension: version 1.0"; -- cgit v1.2.3