minor changes of some conditionals in hawk-cmn.h

This commit is contained in:
hyung-hwan 2020-11-06 14:04:59 +00:00
parent 38c193cd31
commit 2390a8c5cc

View File

@ -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_BCH_T HAWK_SIZEOF_CHAR
#define HAWK_SIZEOF_BCI_T HAWK_SIZEOF_INT #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(__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_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 */ typedef char32_t hawk_uchu_t; /* same as hawk_uch_t as it is already unsigned */
# define HAWK_SIZEOF_UCH_T 4 # 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_SIZEOF_UCH_T 2
# define HAWK_USE_PREFIX_SMALL_U # define HAWK_USE_PREFIX_SMALL_U
# endif # 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 wchar_t hawk_uch_t;
typedef hawk_uint32_t hawk_uchu_t; typedef hawk_uint32_t hawk_uchu_t;
# define HAWK_SIZEOF_UCH_T 4 # 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. // for this library.
HAWK_STATIC_ASSERT (HAWK_WIDE_CHAR_SIZE == sizeof(hawk_uch_t)); 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 wchar_t hawk_uch_t;
typedef hawk_uint16_t hawk_uchu_t; typedef hawk_uint16_t hawk_uchu_t;
# define HAWK_SIZEOF_UCH_T 2 # 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. // gcc/g++/clang/clang++: -fshort-wchar makes wchar_t to 2 bytes.
HAWK_STATIC_ASSERT (HAWK_WIDE_CHAR_SIZE == sizeof(hawk_uch_t)); 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 __CHAR32_TYPE__ hawk_uch_t;
typedef hawk_uint32_t hawk_uchu_t; typedef hawk_uint32_t hawk_uchu_t;
# define HAWK_SIZEOF_UCH_T 4 # 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 # define HAWK_USE_PREFIX_BIG_U
# endif # 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_uch_t;
typedef hawk_uint32_t hawk_uchu_t; typedef hawk_uint32_t hawk_uchu_t;
# define HAWK_SIZEOF_UCH_T 4 # define HAWK_SIZEOF_UCH_T 4