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 *