diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2015-11-06 16:30:33 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2015-11-06 16:30:33 +0000 |
commit | a8ce1f9346beb8f6af8a2704f58ad1be8a491a40 (patch) | |
tree | 1176af75445468319b8f0983434244892aba9031 /configure | |
parent | bdcb15a7e65b5df030d7dac778cb68ac4e3277e6 (diff) | |
download | mandoc-a8ce1f9346beb8f6af8a2704f58ad1be8a491a40.tar.gz |
Use getprogname(3) rather than __progname.
Suggested by Joerg@ Sonnenberger (NetBSD).
Last year, deraadt@ confirmed on tech@ that this "has the potential
to be more portable", and micro-optimizing for speed is not relevant
here. Also gets rid of one global variable.
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -290,7 +290,6 @@ echo echo "#define MAN_CONF_FILE \"/etc/${MANM_MANCONF}\"" echo "#define MANPATH_DEFAULT \"${MANPATH_DEFAULT}\"" [ -n "${OSNAME}" ] && echo "#define OSNAME \"${OSNAME}\"" -[ ${HAVE_PROGNAME} -eq 0 ] && echo "#define __progname mandoc_progname" [ -n "${HOMEBREWDIR}" ] && echo "#define HOMEBREWDIR \"${HOMEBREWDIR}\"" cat << __HEREDOC__ @@ -359,6 +358,11 @@ fi [ ${HAVE_MKDTEMP} -eq 0 ] && \ echo "extern char *mkdtemp(char *);" +if [ ${HAVE_PROGNAME} -eq 0 ]; then + echo "extern const char *getprogname(void);" + echo "extern void setprogname(const char *);" +fi + [ ${HAVE_REALLOCARRAY} -eq 0 ] && \ echo "extern void *reallocarray(void *, size_t, size_t);" |