/* This next group is only used on EBCDIC platforms, so theoretically could be
* shared with something entirely different that's only on ASCII platforms */
-# define _CC_UTF8_IS_START 29
-# define _CC_UTF8_IS_DOWNGRADEABLE_START 30
-# define _CC_UTF8_IS_CONTINUATION 31
-/* Unused: 24-28
+# define _CC_UTF8_START_BYTE_IS_FOR_AT_LEAST_SURROGATE 28
+# define _CC_UTF8_IS_START 29
+# define _CC_UTF8_IS_DOWNGRADEABLE_START 30
+# define _CC_UTF8_IS_CONTINUATION 31
+/* Unused: 24-27
* If more bits are needed, one could add a second word for non-64bit
* QUAD_IS_INT systems, using some #ifdefs to distinguish between having a 2nd
* word or not. The IS_IN_SOME_FOLD bit is the most easily expendable, as it
* As well as avoiding the need for a run-time check in some cases, it's
* designed to avoid compiler warnings like:
* comparison is always false due to limited range of data type
+ * It's mathematically equivalent to
+ * max(n) * sizeof(t) > MEM_SIZE_MAX
*/
# define _MEM_WRAP_NEEDS_RUNTIME_CHECK(n,t) \
- (sizeof(t) > ((MEM_SIZE)1 << 8*(sizeof(MEM_SIZE) - sizeof(n))))
+ ( sizeof(MEM_SIZE) < sizeof(n) \
+ || sizeof(t) > ((MEM_SIZE)1 << 8*(sizeof(MEM_SIZE) - sizeof(n))))
/* This is written in a slightly odd way to avoid various spurious
* compiler warnings. We *want* to write the expression as