Changeset 10633


Ignore:
Timestamp:
May 6, 2010, 3:07:18 PM (8 years ago)
Author:
charles
Message:

(trunk libT) tweak MAX_PATH_LENGTH a little for better portability -- defer to limits.h's definition when present

Location:
trunk/libtransmission
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/bencode.c

    r10629 r10633  
    16221622    int fd;
    16231623    int err = 0;
    1624     char buf[MAX_PATH_LENGTH];
     1624    char buf[TR_MAX_PATH];
    16251625
    16261626    /* follow symlinks to find the "real" file, to make sure the temporary
  • trunk/libtransmission/fdlimit.c

    r10336 r10633  
    6868#include "fdlimit.h"
    6969#include "net.h"
    70 #include "platform.h" /* MAX_PATH_LENGTH, TR_PATH_DELIMITER */
     70#include "platform.h" /* TR_MAX_PATH, TR_PATH_DELIMITER */
    7171#include "session.h"
    7272#include "torrent.h" /* tr_isTorrent() */
     
    8888    int              torrentId;
    8989    tr_file_index_t  fileNum;
    90     char             filename[MAX_PATH_LENGTH];
     90    char             filename[TR_MAX_PATH];
    9191    int              fd;
    9292    uint64_t         date;
  • trunk/libtransmission/makemeta.c

    r10521 r10633  
    2727#include "bencode.h"
    2828#include "makemeta.h"
    29 #include "platform.h" /* threads, locks */
     29#include "platform.h" /* threads, locks, TR_PATH_MAX */
    3030#include "utils.h" /* buildpath */
    3131#include "version.h"
     
    316316    for( prev = pch = file->filename + topLen; ; ++pch )
    317317    {
    318         char buf[MAX_PATH_LENGTH];
     318        char buf[TR_MAX_PATH];
    319319
    320320        if( *pch && *pch != TR_PATH_DELIMITER )
  • trunk/libtransmission/platform.c

    r10417 r10633  
    278278        path = tr_buildPath( appdata, "Transmission", NULL );
    279279#elif defined( __HAIKU__ )
    280         char buf[MAX_PATH_LENGTH];
     280        char buf[TR_PATH_MAX];
    281281        find_directory( B_USER_SETTINGS_DIRECTORY, -1, true, buf, sizeof(buf) );
    282282        path = tr_buildPath( buf, "Transmission", NULL );
     
    437437                              appname, NULL );
    438438#elif defined( WIN32 )
    439             char appdata[MAX_PATH]; /* SHGetFolderPath() requires MAX_PATH */
     439            char appdata[TR_MAX_PATH]; /* SHGetFolderPath() requires MAX_PATH */
    440440            SHGetFolderPath( NULL, CSIDL_APPDATA, NULL, 0, appdata );
    441441            s = tr_buildPath( appdata, appname, NULL );
    442442#elif defined( __HAIKU__ )
    443             char buf[MAX_PATH_LENGTH];
     443            char buf[TR_MAX_PATH];
    444444            find_directory( B_USER_SETTINGS_DIRECTORY, -1, true, buf, sizeof(buf) );
    445445            s = tr_buildPath( buf, appname, NULL );
  • trunk/libtransmission/platform.h

    r10546 r10633  
    2727
    2828#ifdef WIN32
    29  #include <windows.h>
    30  #define MAX_PATH_LENGTH  MAX_PATH
     29 #include <windows.h> /* MAX_PATH */
    3130#else
    32  #define MAX_PATH_LENGTH  4096
     31 #include <limits.h> /* MAX_PATH */
     32#endif
     33#ifdef MAX_PATH
     34 #define TR_MAX_PATH MAX_PATH
     35#else
     36 #define TR_MAX_PATH 4096
    3337#endif
    3438
Note: See TracChangeset for help on using the changeset viewer.