From 2390a8c5cc5512b3794c27c80eaf53848230a574 Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Fri, 6 Nov 2020 14:04:59 +0000 Subject: [PATCH] minor changes of some conditionals in hawk-cmn.h --- hawk/lib/hawk-cmn.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/hawk/lib/hawk-cmn.h b/hawk/lib/hawk-cmn.h index 9a3474c5..5a0ec375 100644 --- a/hawk/lib/hawk-cmn.h +++ b/hawk/lib/hawk-cmn.h @@ -476,9 +476,9 @@ typedef unsigned char hawk_bchu_t; /* unsigned version of hawk_bch_t f #define HAWK_SIZEOF_BCH_T HAWK_SIZEOF_CHAR #define HAWK_SIZEOF_BCI_T HAWK_SIZEOF_INT -// You may specify -DHAWK_USE_CXX_CHAR16_T in CXXFLAGS to force char16_t with c++. +/* You may specify -DHAWK_USE_CXX_CHAR16_T in CXXFLAGS to force char16_t with c++. */ #if (defined(__cplusplus) && (defined(HAWK_USE_CXX_CHAR16_T) || (__cplusplus >= 201103L) || (defined(_MSC_VER) && _MSC_VER >= 1900))) /* user chosen or C++11 or later */ -# if defined(HAWK_WIDE_CHAR_SIZE) && (HAWK_WIDE_CHAR_SIZE >= 4) +# if defined(HAWK_WIDE_CHAR_SIZE) && (HAWK_WIDE_CHAR_SIZE == 4) typedef char32_t hawk_uch_t; /* char32_t is an unsigned integer type used for 32-bit wide characters */ typedef char32_t hawk_uchu_t; /* same as hawk_uch_t as it is already unsigned */ # define HAWK_SIZEOF_UCH_T 4 @@ -489,7 +489,7 @@ typedef unsigned char hawk_bchu_t; /* unsigned version of hawk_bch_t f # define HAWK_SIZEOF_UCH_T 2 # define HAWK_USE_PREFIX_SMALL_U # endif -#elif defined(__cplusplus) && defined(HAWK_WIDE_CHAR_SIZE) && (HAWK_WIDE_CHAR_SIZE >= 4) && (HAWK_SIZEOF_WCHAR_T >= 4) +#elif defined(__cplusplus) && defined(HAWK_WIDE_CHAR_SIZE) && (HAWK_WIDE_CHAR_SIZE == 4) && (HAWK_WIDE_CHAR_SIZE == HAWK_SIZEOF_WCHAR_T) typedef wchar_t hawk_uch_t; typedef hawk_uint32_t hawk_uchu_t; # define HAWK_SIZEOF_UCH_T 4 @@ -498,7 +498,7 @@ typedef unsigned char hawk_bchu_t; /* unsigned version of hawk_bch_t f // for this library. HAWK_STATIC_ASSERT (HAWK_WIDE_CHAR_SIZE == sizeof(hawk_uch_t)); -#elif defined(__cplusplus) && defined(HAWK_WIDE_CHAR_SIZE) && (HAWK_WIDE_CHAR_SIZE == 2) && (HAWK_SIZEOF_WCHAR_T == 2) +#elif defined(__cplusplus) && defined(HAWK_WIDE_CHAR_SIZE) && (HAWK_WIDE_CHAR_SIZE == 2) && (HAWK_WIDE_CHAR_SIZE == HAWK_SIZEOF_WCHAR_T) typedef wchar_t hawk_uch_t; typedef hawk_uint16_t hawk_uchu_t; # define HAWK_SIZEOF_UCH_T 2 @@ -510,7 +510,7 @@ typedef unsigned char hawk_bchu_t; /* unsigned version of hawk_bch_t f // gcc/g++/clang/clang++: -fshort-wchar makes wchar_t to 2 bytes. HAWK_STATIC_ASSERT (HAWK_WIDE_CHAR_SIZE == sizeof(hawk_uch_t)); -#elif defined(HAWK_WIDE_CHAR_SIZE) && (HAWK_WIDE_CHAR_SIZE >= 4) && defined(__CHAR32_TYPE__) && defined(HAWK_HAVE_PREFIX_BIG_U) +#elif defined(HAWK_WIDE_CHAR_SIZE) && (HAWK_WIDE_CHAR_SIZE == 4) && defined(__CHAR32_TYPE__) && defined(HAWK_HAVE_PREFIX_BIG_U) typedef __CHAR32_TYPE__ hawk_uch_t; typedef hawk_uint32_t hawk_uchu_t; # define HAWK_SIZEOF_UCH_T 4 @@ -518,7 +518,7 @@ typedef unsigned char hawk_bchu_t; /* unsigned version of hawk_bch_t f # define HAWK_USE_PREFIX_BIG_U # endif -#elif defined(HAWK_WIDE_CHAR_SIZE) && (HAWK_WIDE_CHAR_SIZE >= 4) +#elif defined(HAWK_WIDE_CHAR_SIZE) && (HAWK_WIDE_CHAR_SIZE == 4) typedef hawk_uint32_t hawk_uch_t; typedef hawk_uint32_t hawk_uchu_t; # define HAWK_SIZEOF_UCH_T 4