1 /* Test of <uchar.h> substitute. 2 Copyright (C) 2019-2021 Free Software Foundation, Inc. 3 4 This program is free software: you can redistribute it and/or modify 5 it under the terms of the GNU General Public License as published by 6 the Free Software Foundation; either version 3 of the License, or 7 (at your option) any later version. 8 9 This program is distributed in the hope that it will be useful, 10 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 GNU General Public License for more details. 13 14 You should have received a copy of the GNU General Public License 15 along with this program. If not, see <https://www.gnu.org/licenses/>. */ 16 17 /* Written by Bruno Haible <bruno@clisp.org>, 2019. */ 18 19 #include <config.h> 20 21 #include <uchar.h> 22 23 #include "verify.h" 24 25 /* Check that the types are defined. */ 26 mbstate_t a = { 0 }; 27 size_t b = 5; 28 char16_t c = 'x'; 29 char32_t d = 'y'; 30 31 /* Check that char16_t and char32_t are unsigned types. */ 32 verify ((char16_t)(-1) >= 0); 33 #if !defined __HP_cc 34 verify ((char32_t)(-1) >= 0); 35 #endif 36 37 /* Check that char32_t is at least 31 bits wide. */ 38 verify ((char32_t)0x7FFFFFFF != (char32_t)0x3FFFFFFF); 39 40 /* Check that _GL_LARGE_CHAR32_T is correctly defined. */ 41 #if _GL_LARGE_CHAR32_T 42 verify (sizeof (char32_t) > sizeof (wchar_t)); 43 #else 44 verify (sizeof (char32_t) == sizeof (wchar_t)); 45 #endif 46 47 int 48 main (void) /* */ 49 { 50 return 0; 51 }