diff -r f4406d746d27 Objects/stringlib/codecs.h --- a/Objects/stringlib/codecs.h Thu May 05 09:26:07 2016 +0300 +++ b/Objects/stringlib/codecs.h Thu May 05 09:32:54 2016 +0300 @@ -1,6 +1,8 @@ /* stringlib: codec implementations */ -#if STRINGLIB_IS_UNICODE +#if !STRINGLIB_IS_UNICODE +# error "codecs.h is specific to Unicode" +#endif /* Mask to quickly check whether a C 'long' contains a non-ASCII, UTF8-encoded char. */ @@ -823,5 +825,3 @@ STRINGLIB(utf32_encode)(const STRINGLIB_ #undef SWAB4 #endif - -#endif /* STRINGLIB_IS_UNICODE */ diff -r f4406d746d27 Objects/stringlib/ctype.h --- a/Objects/stringlib/ctype.h Thu May 05 09:26:07 2016 +0300 +++ b/Objects/stringlib/ctype.h Thu May 05 09:32:54 2016 +0300 @@ -1,5 +1,6 @@ -/* NOTE: this API is -ONLY- for use with single byte character strings. */ -/* Do not use it with Unicode. */ +#if STRINGLIB_IS_UNICODE +# error "ctype.h only compatible with byte-wise strings" +#endif #include "bytes_methods.h" diff -r f4406d746d27 Objects/stringlib/find_max_char.h --- a/Objects/stringlib/find_max_char.h Thu May 05 09:26:07 2016 +0300 +++ b/Objects/stringlib/find_max_char.h Thu May 05 09:32:54 2016 +0300 @@ -1,6 +1,8 @@ /* Finding the optimal width of unicode characters in a buffer */ -#if STRINGLIB_IS_UNICODE +#if !STRINGLIB_IS_UNICODE +# error "find_max_char.h is specific to Unicode" +#endif /* Mask to quickly check whether a C 'long' contains a non-ASCII, UTF8-encoded char. */ @@ -129,5 +131,4 @@ STRINGLIB(find_max_char)(const STRINGLIB #undef MAX_CHAR_UCS4 #endif /* STRINGLIB_SIZEOF_CHAR == 1 */ -#endif /* STRINGLIB_IS_UNICODE */ diff -r f4406d746d27 Objects/stringlib/join.h --- a/Objects/stringlib/join.h Thu May 05 09:26:07 2016 +0300 +++ b/Objects/stringlib/join.h Thu May 05 09:32:54 2016 +0300 @@ -1,6 +1,6 @@ /* stringlib: bytes joining implementation */ -#if STRINGLIB_SIZEOF_CHAR != 1 +#if STRINGLIB_IS_UNICODE #error join.h only compatible with byte-wise strings #endif diff -r f4406d746d27 Objects/stringlib/localeutil.h --- a/Objects/stringlib/localeutil.h Thu May 05 09:26:07 2016 +0300 +++ b/Objects/stringlib/localeutil.h Thu May 05 09:32:54 2016 +0300 @@ -2,8 +2,8 @@ #include -#ifndef STRINGLIB_IS_UNICODE -# error "localeutil is specific to Unicode" +#if !STRINGLIB_IS_UNICODE +# error "localeutil.h is specific to Unicode" #endif typedef struct { diff -r f4406d746d27 Objects/stringlib/transmogrify.h --- a/Objects/stringlib/transmogrify.h Thu May 05 09:26:07 2016 +0300 +++ b/Objects/stringlib/transmogrify.h Thu May 05 09:32:54 2016 +0300 @@ -1,5 +1,6 @@ -/* NOTE: this API is -ONLY- for use with single byte character strings. */ -/* Do not use it with Unicode. */ +#if STRINGLIB_IS_UNICODE +# error "transmogrify.h only compatible with byte-wise strings" +#endif /* the more complicated methods. parts of these should be pulled out into the shared code in bytes_methods.c to cut down on duplicate code bloat. */