iconv_close.c 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /* Character set conversion.
  2. Copyright (C) 2007, 2009-2021 Free Software Foundation, Inc.
  3. This program is free software; you can redistribute it and/or modify
  4. it under the terms of the GNU Lesser General Public License as published by
  5. the Free Software Foundation; either version 2, or (at your option)
  6. any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU Lesser General Public License for more details.
  11. You should have received a copy of the GNU Lesser General Public License along
  12. with this program; if not, see <https://www.gnu.org/licenses/>. */
  13. #include <config.h>
  14. /* Specification. */
  15. #include <iconv.h>
  16. #include <stdint.h>
  17. int
  18. rpl_iconv_close (iconv_t cd)
  19. #undef iconv_close
  20. {
  21. #if REPLACE_ICONV_UTF
  22. switch ((uintptr_t) cd)
  23. {
  24. case (uintptr_t) _ICONV_UTF8_UTF16BE:
  25. case (uintptr_t) _ICONV_UTF8_UTF16LE:
  26. case (uintptr_t) _ICONV_UTF8_UTF32BE:
  27. case (uintptr_t) _ICONV_UTF8_UTF32LE:
  28. case (uintptr_t) _ICONV_UTF16BE_UTF8:
  29. case (uintptr_t) _ICONV_UTF16LE_UTF8:
  30. case (uintptr_t) _ICONV_UTF32BE_UTF8:
  31. case (uintptr_t) _ICONV_UTF32LE_UTF8:
  32. return 0;
  33. }
  34. #endif
  35. return iconv_close (cd);
  36. }