Changeset 6619


Ignore:
Timestamp:
Aug 21, 2008, 9:04:57 PM (13 years ago)
Author:
charles
Message:
  • add DISABLE_GETTEXT preprocessor directive to turn off i18n in libtransmission for embedded devices.
  • remove `wchar.h' #include from shttpd that broke the compile on embedded devices.
Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/utils.c

    r6618 r6619  
    358358}
    359359
     360/**
     361***
     362**/
     363
     364#ifdef DISABLE_GETTEXT
     365
     366const char*
     367tr_strip_positional_args( const char* str )
     368{
     369    static size_t bufsize = 0;
     370    static char * buf = NULL;
     371    const size_t len = strlen( str );
     372    char * out;
     373
     374    if( bufsize < len ) {
     375        bufsize = len * 2;
     376        buf = tr_renew( char, buf, bufsize );
     377    }
     378
     379    for( out=buf; *str; ++str ) {
     380        *out++ = *str;
     381        if( ( *str == '%' ) && isdigit( str[1] ) ) {
     382            const char * tmp = str + 1;
     383            while( isdigit( *tmp ) )
     384                ++tmp;
     385            if( *tmp == '$' )
     386                str = tmp;
     387        }
     388    }
     389    *out = '\0';
     390
     391    return buf;
     392}
     393
     394#endif
    360395
    361396/**
  • trunk/libtransmission/utils.h

    r6618 r6619  
    9090  #define _(a) (a)
    9191#endif
     92#endif
     93
     94/* #define DISABLE_GETTEXT */
     95#ifdef DISABLE_GETTEXT
     96const char* tr_strip_positional_args( const char* fmt );
     97#undef _
     98#define _(a) tr_strip_positional_args(a)
    9299#endif
    93100
  • trunk/third-party/shttpd/std_includes.h

    r5822 r6619  
    2929#include <stddef.h>
    3030#include <stdio.h>
    31 #include <wchar.h>
    3231
    3332#if defined(_WIN32)             /* Windows specific     */
Note: See TracChangeset for help on using the changeset viewer.