summaryrefslogtreecommitdiff
path: root/base/pipe_.h
diff options
context:
space:
mode:
authorChris Liddell <chris.liddell@artifex.com>2018-02-01 09:46:21 +0000
committerChris Liddell <chris.liddell@artifex.com>2018-02-01 13:02:18 +0000
commit5b546c80e79e6d1f1c6c3a9a71bfb58ee23a328c (patch)
tree8d4688f6dcc1fe406b09a4a2a40ad1a4b27250ad /base/pipe_.h
parent88aea05567f36d4d37c00a51b818c80f88291f6b (diff)
downloadghostpdl-5b546c80e79e6d1f1c6c3a9a71bfb58ee23a328c.tar.gz
Address the popen prototype warning
Only include the hacky popen() prototype if it doesn't already exist in the standard header files.
Diffstat (limited to 'base/pipe_.h')
-rw-r--r--base/pipe_.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/base/pipe_.h b/base/pipe_.h
index ecead635e..34ea30a9d 100644
--- a/base/pipe_.h
+++ b/base/pipe_.h
@@ -33,13 +33,16 @@ extern FILE *mswin_popen(const char *cmd, const char *mode);
# define pclose(file) _pclose(file)
#else /* !__WIN32__ */
/*
- * popen isn't POSIX-standard, so we declare it here.
- * Because of inconsistent (and sometimes incorrect) header files,
- * we must omit the argument list. Unfortunately, this sometimes causes
- * more trouble than it cures.
+ * popen wasn't POSIX-standard from the beginning, and that resulted in
+ * inconsistent and incorrect prototypes and other issues. Hence we include
+ * a declaration here.
+ * But as it is now included in POSIX, we make this optional.
*/
+#if !defined(HAVE_POPEN_PROTO) || HAVE_POPEN_PROTO!=1
extern FILE *popen( /* const char *, const char * */ );
extern int pclose(FILE *);
+#endif /* HAVE_POPEN_PROTO */
+
#endif /* !__WIN32__ */
#endif /* pipe__INCLUDED */