diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2005-02-19 00:32:11 +0000 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2005-02-19 00:32:11 +0000 |
commit | 6d0be7db4b417663ddc40c77978a354415dc82d7 (patch) | |
tree | 0fa7549fe7bb10b18d2bd81b4e86f834c6e794ee /src | |
parent | 5cdcfdebb7aa8283189ab46f5a50a48c1c1f6b36 (diff) | |
download | weechat-6d0be7db4b417663ddc40c77978a354415dc82d7.zip |
Added test of HAVE_ICONV, so compile is ok if iconv is not found
Diffstat (limited to 'src')
-rw-r--r-- | src/common/weechat.c | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/src/common/weechat.c b/src/common/weechat.c index c1e85e4e0..193c63d5d 100644 --- a/src/common/weechat.c +++ b/src/common/weechat.c @@ -8,11 +8,9 @@ * ### WeeChat - Wee Enhanced Environment for Chat ### * ### Fast & light environment for Chat ### * ### ### - * ### By: FlashCode <flashcode@flashtux.org> ### - * ### Bounga <bounga@altern.org> ### - * ### Xahlexx <xahlexx@weeland.org> ### - * ### ### - * ### http://weechat.flashtux.org ### + * ### By FlashCode <flashcode@flashtux.org> ### + ### ### + * ### http://weechat.flashtux.org ### * ### ### * ############################################################################ * @@ -49,7 +47,11 @@ #include <sys/stat.h> #include <time.h> #include <signal.h> + +#ifdef HAVE_ICONV #include <iconv.h> +#endif + #include <langinfo.h> #include "weechat.h" @@ -87,8 +89,11 @@ my_sigint () char * weechat_convert_encoding (char *from_code, char *to_code, char *string) { + char *outbuf; + + #ifdef HAVE_ICONV iconv_t cd; - char *inbuf, *ptr_inbuf, *outbuf, *ptr_outbuf; + char *inbuf, *ptr_inbuf, *ptr_outbuf; int inbytesleft, outbytesleft; if (from_code && from_code[0] && to_code && to_code[0] @@ -119,6 +124,12 @@ weechat_convert_encoding (char *from_code, char *to_code, char *string) } else outbuf = strdup (string); + #else + /* make gcc happy */ + (void) from_code; + (void) to_code; + outbuf = strdup (string); + #endif /* HAVE_ICONV */ return outbuf; } |