xbps.h: drop PATH_MAX completely and use our own definition.

This commit is contained in:
Juan RP 2013-12-29 16:56:43 +01:00
parent 8eb1d3889f
commit d3ffd0885b
2 changed files with 6 additions and 4 deletions

1
configure vendored
View File

@ -206,6 +206,7 @@ fi
case "$OS" in case "$OS" in
linux) linux)
echo "CPPFLAGS += -D_XOPEN_SOURCE=700" >>$CONFIG_MK
echo "CPPFLAGS += -D_FILE_OFFSET_BITS=64" >> $CONFIG_MK echo "CPPFLAGS += -D_FILE_OFFSET_BITS=64" >> $CONFIG_MK
;; ;;
*) *)

View File

@ -27,7 +27,6 @@
#ifndef _XBPS_API_H_ #ifndef _XBPS_API_H_
#define _XBPS_API_H_ #define _XBPS_API_H_
#define _XOPEN_SOURCE 700 /* required by PATH_MAX et al */
#include <stdio.h> #include <stdio.h>
#include <inttypes.h> #include <inttypes.h>
@ -43,6 +42,8 @@
#include <archive.h> #include <archive.h>
#include <archive_entry.h> #include <archive_entry.h>
#define XBPS_MAXPATH 256
/** /**
* @file include/xbps.h * @file include/xbps.h
* @brief XBPS Library API header * @brief XBPS Library API header
@ -542,21 +543,21 @@ struct xbps_handle {
* Root directory for all operations in XBPS. * Root directory for all operations in XBPS.
* If unset, defaults to '/'. * If unset, defaults to '/'.
*/ */
char rootdir[PATH_MAX-1]; char rootdir[XBPS_MAXPATH-1];
/** /**
* @var cachedir * @var cachedir
* *
* Cache directory to store downloaded binary packages. * Cache directory to store downloaded binary packages.
* If unset, defaults to \a XBPS_CACHE_PATH (relative to rootdir). * If unset, defaults to \a XBPS_CACHE_PATH (relative to rootdir).
*/ */
char cachedir[PATH_MAX-1]; char cachedir[XBPS_MAXPATH-1];
/** /**
* @var metadir * @var metadir
* *
* Metadata directory for all operations in XBPS. * Metadata directory for all operations in XBPS.
* If unset, defaults to \a XBPS_CACHE_PATH (relative to rootdir). * If unset, defaults to \a XBPS_CACHE_PATH (relative to rootdir).
*/ */
char metadir[PATH_MAX-1]; char metadir[XBPS_MAXPATH-1];
/** /**
* @var native_arch * @var native_arch
* *