From d3ffd0885b2fe765aa725e654aa2d6c6d9463ca6 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Sun, 29 Dec 2013 16:56:43 +0100 Subject: [PATCH] xbps.h: drop PATH_MAX completely and use our own definition. --- configure | 1 + include/xbps.h.in | 9 +++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/configure b/configure index 96b6b90a..86c97950 100755 --- a/configure +++ b/configure @@ -206,6 +206,7 @@ fi case "$OS" in linux) + echo "CPPFLAGS += -D_XOPEN_SOURCE=700" >>$CONFIG_MK echo "CPPFLAGS += -D_FILE_OFFSET_BITS=64" >> $CONFIG_MK ;; *) diff --git a/include/xbps.h.in b/include/xbps.h.in index a0091d48..22ba1e4c 100644 --- a/include/xbps.h.in +++ b/include/xbps.h.in @@ -27,7 +27,6 @@ #ifndef _XBPS_API_H_ #define _XBPS_API_H_ -#define _XOPEN_SOURCE 700 /* required by PATH_MAX et al */ #include #include @@ -43,6 +42,8 @@ #include #include +#define XBPS_MAXPATH 256 + /** * @file include/xbps.h * @brief XBPS Library API header @@ -542,21 +543,21 @@ struct xbps_handle { * Root directory for all operations in XBPS. * If unset, defaults to '/'. */ - char rootdir[PATH_MAX-1]; + char rootdir[XBPS_MAXPATH-1]; /** * @var cachedir * * Cache directory to store downloaded binary packages. * If unset, defaults to \a XBPS_CACHE_PATH (relative to rootdir). */ - char cachedir[PATH_MAX-1]; + char cachedir[XBPS_MAXPATH-1]; /** * @var metadir * * Metadata directory for all operations in XBPS. * If unset, defaults to \a XBPS_CACHE_PATH (relative to rootdir). */ - char metadir[PATH_MAX-1]; + char metadir[XBPS_MAXPATH-1]; /** * @var native_arch *