summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.in6
-rw-r--r--file_io/unix/dir.c6
-rw-r--r--include/apr.h.in18
-rw-r--r--include/apr.hw9
-rw-r--r--include/arch/win32/fileio.h3
5 files changed, 32 insertions, 10 deletions
diff --git a/configure.in b/configure.in
index d064263bb..72a3c9d67 100644
--- a/configure.in
+++ b/configure.in
@@ -282,14 +282,14 @@ AC_CHECK_HEADERS(net/errno.h)
AC_CHECK_HEADERS(fcntl.h, fcntlh="1", fcntl="0")
AC_CHECK_HEADERS(grp.h)
AC_CHECK_HEADERS(io.h, ioh="1", ioh="0")
-AC_CHECK_HEADERS(limits.h)
+AC_CHECK_HEADERS(limits.h, limitsh="1", limitsh="0")
AC_CHECK_HEADERS(malloc.h)
AC_CHECK_HEADERS(memory.h)
AC_CHECK_HEADERS(netdb.h, netdbh="1", netdbh="0")
AC_CHECK_HEADERS(osreldate.h)
AC_CHECK_HEADERS(process.h)
AC_CHECK_HEADERS(pwd.h)
-AC_CHECK_HEADERS(sys/syslimits.h)
+AC_CHECK_HEADERS(sys/syslimits.h, sys_syslimitsh="1", sys_syslimitsh="0")
AC_CHECK_HEADERS(sys/sem.h)
AC_CHECK_HEADERS(signal.h, signalh="1", signalh="0")
AC_CHECK_HEADERS(stdarg.h, stdargh="1", stdargh="0")
@@ -338,7 +338,9 @@ AC_SUBST(errnoh)
AC_SUBST(direnth)
AC_SUBST(fcntlh)
AC_SUBST(ioh)
+AC_SUBST(limitsh)
AC_SUBST(netdbh)
+AC_SUBST(sys_syslimitsh)
AC_SUBST(netinet_inh)
AC_SUBST(stdargh)
AC_SUBST(stdioh)
diff --git a/file_io/unix/dir.c b/file_io/unix/dir.c
index 8e2ac510d..933427258 100644
--- a/file_io/unix/dir.c
+++ b/file_io/unix/dir.c
@@ -154,11 +154,7 @@ apr_status_t apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted,
wanted &= ~(APR_FINFO_NAME);
if (wanted)
{
-#if defined(PATH_MAX)
- char fspec[PATH_MAX];
-#elif defined(_POSIX_PATH_MAX)
- char fspec[_POSIX_PATH_MAX];
-#endif
+ char fspec[APR_PATH_MAX];
int off;
apr_cpystrn(fspec, thedir->dirname, sizeof(fspec));
off = strlen(fspec);
diff --git a/include/apr.h.in b/include/apr.h.in
index a31e751fd..24ad85126 100644
--- a/include/apr.h.in
+++ b/include/apr.h.in
@@ -31,6 +31,7 @@
#define APR_HAVE_ERRNO_H @errnoh@
#define APR_HAVE_FCNTL_H @fcntlh@
#define APR_HAVE_IO_H @ioh@
+#define APR_HAVE_LIMITS_H @limitsh@
#define APR_HAVE_NETDB_H @netdbh@
#define APR_HAVE_NETINET_IN_H @netinet_inh@
#define APR_HAVE_PTHREAD_H @pthreadh@
@@ -41,6 +42,7 @@
#define APR_HAVE_STRINGS_H @stringsh@
#define APR_HAVE_SYS_SIGNAL_H @sys_signalh@
#define APR_HAVE_SYS_SOCKET_H @sys_socketh@
+#define APR_HAVE_SYS_SYSLIMITS_H @sys_syslimitsh@
#define APR_HAVE_SYS_TYPES_H @sys_typesh@
#define APR_HAVE_SYS_UIO_H @sys_uioh@
#define APR_HAVE_SIGNAL_H @signalh@
@@ -235,4 +237,20 @@ typedef @socklen_t_value@ apr_socklen_t;
#include <os2.h>
#endif
+/* header files for PATH_MAX, _POSIX_PATH_MAX */
+#if APR_HAVE_SYS_SYSLIMITS_H
+#include <sys/syslimits.h>
+#endif
+#if APR_HAVE_LIMITS_H
+#include <limits.h>
+#endif
+
+#if defined(PATH_MAX)
+#define APR_PATH_MAX PATH_MAX
+#elif defined(_POSIX_PATH_MAX)
+#define APR_PATH_MAX _POSIX_PATH_MAX
+#else
+#error no decision has been made on APR_PATH_MAX for your platform
+#endif
+
#endif /* APR_H */
diff --git a/include/apr.hw b/include/apr.hw
index 2f4933f35..a1b00e13c 100644
--- a/include/apr.hw
+++ b/include/apr.hw
@@ -121,6 +121,7 @@
#define APR_HAVE_ERRNO_H 1
#define APR_HAVE_FCNTL_H 1
#define APR_HAVE_IO_H 1
+#define APR_HAVE_LIMITS_H 0
#define APR_HAVE_NETDB_H 0
#define APR_HAVE_NETINET_IN_H 0
#define APR_HAVE_PTHREAD_H 0
@@ -131,6 +132,7 @@
#define APR_HAVE_STRINGS_H 0
#define APR_HAVE_SYS_SIGNAL_H 0
#define APR_HAVE_SYS_SOCKET_H 0
+#define APR_HAVE_SYS_SYSLIMITS_H 0
#define APR_HAVE_SYS_TYPES_H 1
#define APR_HAVE_SYS_UIO_H 0
#define APR_HAVE_SIGNAL_H 1
@@ -297,5 +299,12 @@ struct iovec {
#define STDOUT_FILENO 1
#define STDERR_FILENO 2
+#if APR_HAS_UNICODE_FS
+/* An arbitrary size that is digestable. True max is a bit less than 32000 */
+#define APR_PATH_MAX 8192
+#else /* !APR_HAS_UNICODE_FS */
+#define APR_PATH_MAX MAX_PATH
+#endif
+
#endif /* APR_H */
#endif /* WIN32 */
diff --git a/include/arch/win32/fileio.h b/include/arch/win32/fileio.h
index d620efb01..3f095a9d3 100644
--- a/include/arch/win32/fileio.h
+++ b/include/arch/win32/fileio.h
@@ -99,11 +99,8 @@ apr_status_t utf8_to_unicode_path(apr_wchar_t* dststr, apr_size_t dstchars,
apr_status_t unicode_to_utf8_path(char* dststr, apr_size_t dstchars,
const apr_wchar_t* srcstr);
-/* An arbitrary size that is digestable. True max is a bit less than 32000 */
-#define APR_PATH_MAX 8192
#define APR_FILE_MAX MAX_PATH
#else /* !APR_HAS_UNICODE_FS */
-#define APR_PATH_MAX MAX_PATH
#define APR_FILE_MAX MAX_PATH
#endif