1 /* Conversion to UTF-32 from legacy encodings.
2    Copyright (C) 2002, 2006-2007, 2009-2018 Free Software Foundation, Inc.
3 
4    This program is free software: you can redistribute it and/or
5    modify it under the terms of either:
6 
7      * the GNU Lesser General Public License as published by the Free
8        Software Foundation; either version 3 of the License, or (at your
9        option) any later version.
10 
11    or
12 
13      * the GNU General Public License as published by the Free
14        Software Foundation; either version 2 of the License, or (at your
15        option) any later version.
16 
17    or both in parallel, as here.
18    This program is distributed in the hope that it will be useful,
19    but WITHOUT ANY WARRANTY; without even the implied warranty of
20    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
21    Lesser General Public License for more details.
22 
23    You should have received a copy of the GNU Lesser General Public License
24    along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
25 
26 /* Written by Bruno Haible <bruno@clisp.org>.  */
27 
28 #include <config.h>
29 
30 /* Specification.  */
31 #include "uniconv.h"
32 
33 #include <errno.h>
34 #include <stdlib.h>
35 
36 #include "striconveha.h"
37 #include "unistr.h"
38 
39 /* Name of UTF-32 or UCS-4 encoding with machine dependent endianness and
40    alignment.  */
41 #if defined _LIBICONV_VERSION
42 # define UTF32_NAME "UCS-4-INTERNAL"
43 #elif ((__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)) && !defined __UCLIBC__
44 # define UTF32_NAME "WCHAR_T"
45 #endif
46 
47 #define FUNC u32_conv_from_encoding
48 #define UNIT uint32_t
49 #define U8_TO_U u8_to_u32
50 #define U_MBLEN u32_mblen
51 #if defined UTF32_NAME
52 # define UTF_NAME UTF32_NAME
53 # define HAVE_UTF_NAME 1
54 #endif
55 #include "u-conv-from-enc.h"
56