Skip to content
Browse files

[fix] iconv: do not call iconv_canonicalize if _LIBICONV_H not define…

…d, missing in gconv (_ICONV_H)
  • Loading branch information...
1 parent e013690 commit a7c7f398ff21ae2ae5bb2caedd4c4359b2f6b80f @Aqua-Ye Aqua-Ye committed Apr 27, 2012
Showing with 5 additions and 0 deletions.
  1. +5 −0 libbase/mliconv.c
View
5 libbase/mliconv.c
@@ -122,8 +122,13 @@ CAMLprim value mliconv_open(value tocodev, value fromcodev)
result = alloc_custom(&iconv_ops, sizeof(struct mliconv_t), 0, 1);
struct mliconv_t *internal = mliconv_val(result);
internal->handle = handle;
+#ifdef _LIBICONV_H
internal->tocode = strdup(iconv_canonicalize(tocode));
internal->fromcode = strdup(iconv_canonicalize(fromcode));
+#else /* iconv_canonicalize does not exist in gconv */
+ internal->tocode = strdup(tocode);
+ internal->fromcode = strdup(fromcode);
+#endif
CAMLreturn(result);
}

0 comments on commit a7c7f39

Please sign in to comment.
Something went wrong with that request. Please try again.