move iconv_close to its own translation unit
authorRich Felker <dalias@aerifal.cx>
Fri, 10 Nov 2017 05:27:34 +0000 (00:27 -0500)
committerRich Felker <dalias@aerifal.cx>
Fri, 10 Nov 2017 05:27:34 +0000 (00:27 -0500)
this is in preparation to support stateful conversion descriptors,
which are necessarily allocated and thus must be freed in iconv_close.
putting it in a separate TU will avoid pulling in free if iconv_close
is not referenced.

src/locale/iconv.c
src/locale/iconv_close.c [new file with mode: 0644]

index 5f1b0a3..c64bcf3 100644 (file)
@@ -129,11 +129,6 @@ iconv_t iconv_open(const char *to, const char *from)
        return combine_to_from(t, f);
 }
 
-int iconv_close(iconv_t cd)
-{
-       return 0;
-}
-
 static unsigned get_16(const unsigned char *s, int e)
 {
        e &= 1;
diff --git a/src/locale/iconv_close.c b/src/locale/iconv_close.c
new file mode 100644 (file)
index 0000000..fac681c
--- /dev/null
@@ -0,0 +1,6 @@
+#include <iconv.h>
+
+int iconv_close(iconv_t cd)
+{
+       return 0;
+}