mirror of
https://github.com/transmission/transmission
synced 2024-12-25 01:03:01 +00:00
utils.h's public function tr_realpath() function relies on the private constant TR_MAX_PATH. Make TR_MAX_PATH public.
This commit is contained in:
parent
ab93e2d07b
commit
ae972b50c4
2 changed files with 14 additions and 13 deletions
|
@ -20,18 +20,6 @@
|
||||||
#define TR_PATH_DELIMITER '/'
|
#define TR_PATH_DELIMITER '/'
|
||||||
#define TR_PATH_DELIMITER_STR "/"
|
#define TR_PATH_DELIMITER_STR "/"
|
||||||
|
|
||||||
#ifdef WIN32
|
|
||||||
#include <windef.h> /* MAX_PATH */
|
|
||||||
#define TR_PATH_MAX (MAX_PATH + 1)
|
|
||||||
#else
|
|
||||||
#include <limits.h> /* PATH_MAX */
|
|
||||||
#ifdef PATH_MAX
|
|
||||||
#define TR_PATH_MAX PATH_MAX
|
|
||||||
#else
|
|
||||||
#define TR_PATH_MAX 4096
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @addtogroup tr_session Session
|
* @addtogroup tr_session Session
|
||||||
* @{
|
* @{
|
||||||
|
|
|
@ -513,7 +513,20 @@ static inline time_t tr_time( void ) { return __tr_current_time; }
|
||||||
/** @brief Private libtransmission function to update tr_time()'s counter */
|
/** @brief Private libtransmission function to update tr_time()'s counter */
|
||||||
static inline void tr_timeUpdate( time_t now ) { __tr_current_time = now; }
|
static inline void tr_timeUpdate( time_t now ) { __tr_current_time = now; }
|
||||||
|
|
||||||
/** @brief Portability wrapper for realpath() that uses the system implementation if available */
|
#ifdef WIN32
|
||||||
|
#include <windef.h> /* MAX_PATH */
|
||||||
|
#define TR_PATH_MAX (MAX_PATH + 1)
|
||||||
|
#else
|
||||||
|
#include <limits.h> /* PATH_MAX */
|
||||||
|
#ifdef PATH_MAX
|
||||||
|
#define TR_PATH_MAX PATH_MAX
|
||||||
|
#else
|
||||||
|
#define TR_PATH_MAX 4096
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/** @brief Portability wrapper for realpath() that uses the system implementation if available.
|
||||||
|
@param resolved_path should be TR_PATH_MAX or larger */
|
||||||
char* tr_realpath( const char *path, char * resolved_path );
|
char* tr_realpath( const char *path, char * resolved_path );
|
||||||
|
|
||||||
/** @brief Portability wrapper for htonll() that uses the system implementation if available */
|
/** @brief Portability wrapper for htonll() that uses the system implementation if available */
|
||||||
|
|
Loading…
Reference in a new issue