summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChoe Hwanjin <choe.hwanjin@gmail.com>2011-07-18 23:30:24 +0900
committerChoe Hwanjin <choe.hwanjin@gmail.com>2011-07-18 23:30:24 +0900
commit6c4265504571dd3176f6a3a62f94658e4a94d61a (patch)
tree22efb5ef84ecf86afe96790b5ec95a923332e097
parent5ab14fa01d32432b8d7ce68789898d3380dd3ed8 (diff)
downloadlibhangul-6c4265504571dd3176f6a3a62f94658e4a94d61a.tar.gz
AM_ICONV 매크로 사용
freebsd에서 컴파일 오류가 발생하는 것을 막기 위한 것 git-svn-id: http://kldp.net/svn/hangul/libhangul/trunk@262 8f00fcd2-89fc-0310-932e-b01be5b65e01
-rw-r--r--configure.ac1
-rw-r--r--test/Makefile.am2
-rw-r--r--test/hangul.c6
-rw-r--r--tools/Makefile.am2
-rw-r--r--tools/hangul.c6
5 files changed, 13 insertions, 4 deletions
diff --git a/configure.ac b/configure.ac
index d4581d6..cb710fc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -50,6 +50,7 @@ AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", gettext package name)
AM_GNU_GETTEXT([external])
AM_GNU_GETTEXT_VERSION(0.11)
+AM_ICONV
# Checks for unit test framework
PKG_PROG_PKG_CONFIG
diff --git a/test/Makefile.am b/test/Makefile.am
index e47221b..8c7c80b 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -3,7 +3,7 @@ noinst_PROGRAMS = hangul hanja
hangul_CFLAGS =
hangul_SOURCES = hangul.c
-hangul_LDADD = ../hangul/libhangul.la $(LTLIBINTL)
+hangul_LDADD = ../hangul/libhangul.la $(LTLIBINTL) $(LTLIBICONV)
hanja_CFLAGS =
hanja_SOURCES = hanja.c
diff --git a/test/hangul.c b/test/hangul.c
index 4023759..7f829a3 100644
--- a/test/hangul.c
+++ b/test/hangul.c
@@ -15,10 +15,14 @@
#define UCS4 "UCS-4LE"
#endif
+#ifndef ICONV_CONST
+#define ICONV_CONST
+#endif
+
void ucs4_to_utf8(char *buf, const ucschar *ucs4, size_t bufsize)
{
size_t n;
- char* inbuf;
+ ICONV_CONST char* inbuf;
size_t inbytesleft;
char* outbuf;
size_t outbytesleft;
diff --git a/tools/Makefile.am b/tools/Makefile.am
index 22f95fb..cf27653 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -3,4 +3,4 @@ bin_PROGRAMS = hangul
hangul_SOURCES = hangul.c
hangul_CFLAGS = -DLOCALEDIR=\"$(localedir)\"
-hangul_LDADD = ../hangul/libhangul.la $(LTLIBINTL)
+hangul_LDADD = ../hangul/libhangul.la $(LTLIBINTL) $(LTLIBICONV)
diff --git a/tools/hangul.c b/tools/hangul.c
index 3557106..bc6bba6 100644
--- a/tools/hangul.c
+++ b/tools/hangul.c
@@ -44,6 +44,10 @@
#define UCS4 "UCS-4LE"
#endif
+#ifndef ICONV_CONST
+#define ICONV_CONST
+#endif
+
static const char* program_name = "hangul";
static iconv_t cd_ucs4_to_utf8 = (iconv_t)-1;
@@ -181,7 +185,7 @@ static int
fputs_ucschar(const ucschar* str, FILE* stream)
{
char buf[512];
- char* inbuf;
+ ICONV_CONST char* inbuf;
char* outbuf;
size_t inbytesleft;
size_t outbytesleft;