1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-24 08:43:27 +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:
Jordan Lee 2011-10-25 15:57:10 +00:00
parent ab93e2d07b
commit ae972b50c4
2 changed files with 14 additions and 13 deletions

View file

@ -20,18 +20,6 @@
#define TR_PATH_DELIMITER '/'
#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
* @{

View file

@ -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 */
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 );
/** @brief Portability wrapper for htonll() that uses the system implementation if available */