diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/shmbutil.h | 12 | ||||
-rw-r--r-- | include/stdc.h | 2 |
2 files changed, 13 insertions, 1 deletions
diff --git a/include/shmbutil.h b/include/shmbutil.h index 7fe2f8ea..b700504d 100644 --- a/include/shmbutil.h +++ b/include/shmbutil.h @@ -70,6 +70,11 @@ extern size_t xmbsrtowcs __P((wchar_t *, const char **, size_t, mbstate_t *)); extern char *xstrchr __P((const char *, int)); +#ifndef MB_INVALIDCH +#define MB_INVALIDCH(x) ((x) == (size_t)-1 || (x) == (size_t)-2) +#define MB_NULLWCH(x) ((x) == 0) +#endif + #else /* !HANDLE_MULTIBYTE */ #undef MB_LEN_MAX @@ -81,6 +86,11 @@ extern char *xstrchr __P((const char *, int)); #undef xstrchr #define xstrchr(s, c) strchr(s, c) +#ifndef MB_INVALIDCH +#define MB_INVALIDCH(x) (0) +#define MB_NULLWCH(x) (0) +#endif + #endif /* !HANDLE_MULTIBYTE */ /* Declare and initialize a multibyte state. Call must be terminated @@ -120,6 +130,8 @@ extern char *xstrchr __P((const char *, int)); state = state_bak; \ (_i)++; \ } \ + else if (mblength == 0) \ + (_i)++; \ else \ (_i) += mblength; \ } \ diff --git a/include/stdc.h b/include/stdc.h index 05b743e5..efab869e 100644 --- a/include/stdc.h +++ b/include/stdc.h @@ -66,7 +66,7 @@ #endif /* !__STDC__ */ #ifndef __attribute__ -# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8) || __STRICT_ANSI__ +# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8) # define __attribute__(x) # endif #endif |