summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2005-02-19 00:32:11 +0000
committerSebastien Helleu <flashcode@flashtux.org>2005-02-19 00:32:11 +0000
commit6d0be7db4b417663ddc40c77978a354415dc82d7 (patch)
tree0fa7549fe7bb10b18d2bd81b4e86f834c6e794ee
parent5cdcfdebb7aa8283189ab46f5a50a48c1c1f6b36 (diff)
downloadweechat-6d0be7db4b417663ddc40c77978a354415dc82d7.zip
Added test of HAVE_ICONV, so compile is ok if iconv is not found
-rw-r--r--src/common/weechat.c23
-rw-r--r--weechat/src/common/weechat.c23
2 files changed, 34 insertions, 12 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;
}
diff --git a/weechat/src/common/weechat.c b/weechat/src/common/weechat.c
index c1e85e4e0..193c63d5d 100644
--- a/weechat/src/common/weechat.c
+++ b/weechat/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;
}