Blame lib/iconv_close.c

Packit 8f70b4
/* Character set conversion.
Packit 8f70b4
   Copyright (C) 2007, 2009-2018 Free Software Foundation, Inc.
Packit 8f70b4
Packit 8f70b4
   This program is free software; you can redistribute it and/or modify
Packit 8f70b4
   it under the terms of the GNU General Public License as published by
Packit 8f70b4
   the Free Software Foundation; either version 3, or (at your option)
Packit 8f70b4
   any later version.
Packit 8f70b4
Packit 8f70b4
   This program is distributed in the hope that it will be useful,
Packit 8f70b4
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 8f70b4
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit 8f70b4
   GNU General Public License for more details.
Packit 8f70b4
Packit 8f70b4
   You should have received a copy of the GNU General Public License along
Packit 8f70b4
   with this program; if not, see <https://www.gnu.org/licenses/>.  */
Packit 8f70b4
Packit 8f70b4
#include <config.h>
Packit 8f70b4
Packit 8f70b4
/* Specification.  */
Packit 8f70b4
#include <iconv.h>
Packit 8f70b4
Packit 8f70b4
#include <stdint.h>
Packit 8f70b4
#ifndef uintptr_t
Packit 8f70b4
# define uintptr_t unsigned long
Packit 8f70b4
#endif
Packit 8f70b4
Packit 8f70b4
int
Packit 8f70b4
rpl_iconv_close (iconv_t cd)
Packit 8f70b4
#undef iconv_close
Packit 8f70b4
{
Packit 8f70b4
#if REPLACE_ICONV_UTF
Packit 8f70b4
  switch ((uintptr_t) cd)
Packit 8f70b4
    {
Packit 8f70b4
    case (uintptr_t) _ICONV_UTF8_UTF16BE:
Packit 8f70b4
    case (uintptr_t) _ICONV_UTF8_UTF16LE:
Packit 8f70b4
    case (uintptr_t) _ICONV_UTF8_UTF32BE:
Packit 8f70b4
    case (uintptr_t) _ICONV_UTF8_UTF32LE:
Packit 8f70b4
    case (uintptr_t) _ICONV_UTF16BE_UTF8:
Packit 8f70b4
    case (uintptr_t) _ICONV_UTF16LE_UTF8:
Packit 8f70b4
    case (uintptr_t) _ICONV_UTF32BE_UTF8:
Packit 8f70b4
    case (uintptr_t) _ICONV_UTF32LE_UTF8:
Packit 8f70b4
      return 0;
Packit 8f70b4
    }
Packit 8f70b4
#endif
Packit 8f70b4
  return iconv_close (cd);
Packit 8f70b4
}