| diff -ru SDL2-2.0.8.orig/src/video/windows/SDL_windowsmessagebox.c SDL2-2.0.8/src/video/windows/SDL_windowsmessagebox.c |
| |
| |
| @@ -350,7 +350,11 @@ |
| HFONT DialogFont; |
| SIZE Size; |
| RECT TextSize; |
| +#ifdef __midipix__ |
| + uint16_t *wmessage; |
| +#else |
| wchar_t* wmessage; |
| +#endif |
| TEXTMETRIC TM; |
| |
| HWND ParentWindow = NULL; |
| |
| diff -ru SDL2-2.0.12.orig/src/stdlib/SDL_string.c SDL2-2.0.12/src/stdlib/SDL_string.c |
| |
| |
| @@ -421,6 +421,63 @@ |
| #endif /* HAVE_STRLEN */ |
| } |
| |
| +#ifdef __midipix__ |
| +#include <u16ports/u16ports.h> |
| + |
| +size_t |
| +SDL_wcslen(const uint16_t * string) |
| +{ |
| + return u16_wcslen(string); |
| +} |
| + |
| +size_t |
| +SDL_wcslcpy(SDL_OUT_Z_CAP(maxlen) uint16_t *dst, const uint16_t *src, size_t maxlen) |
| +{ |
| + size_t srclen = u16_wcslen(src); |
| + if(maxlen > 0) { |
| + size_t len = SDL_min(srclen, maxlen - 1); |
| + SDL_memcpy(dst, src, len * sizeof(uint16_t)); |
| + dst[len] = '\0'; |
| + } |
| + return srclen; |
| +} |
| + |
| +size_t |
| +SDL_wcslcat(SDL_INOUT_Z_CAP(maxlen) uint16_t *dst, const uint16_t *src, size_t maxlen) |
| +{ |
| + size_t dstlen = u16_wcslen(dst); |
| + size_t srclen = u16_wcslen(src); |
| + if (dstlen < maxlen) { |
| + SDL_wcslcpy(dst + dstlen, src, maxlen - dstlen); |
| + } |
| + return dstlen + srclen; |
| +} |
| + |
| +uint16_t * |
| +SDL_wcsdup(const uint16_t *string) |
| +{ |
| + return u16_wcsdup(string); |
| +} |
| + |
| +uint16_t * |
| +SDL_wcsstr(const uint16_t *haystack, const uint16_t *needle) |
| +{ |
| + return SDL_const_cast(uint16_t*,u16_wcsstr(haystack, needle)); |
| +} |
| + |
| +int |
| +SDL_wcscmp(const uint16_t *str1, const uint16_t *str2) |
| +{ |
| + return u16_wcscmp(str1, str2); |
| +} |
| + |
| +int |
| +SDL_wcsncmp(const uint16_t *str1, const uint16_t *str2, size_t maxlen) |
| +{ |
| + return u16_wcsncmp(str1, str2, maxlen); |
| +} |
| + |
| +#else /* !__MIDIPIX__ */ |
| size_t |
| SDL_wcslen(const wchar_t * string) |
| { |
| @@ -525,6 +582,7 @@ |
| return (int)(*str1 - *str2); |
| #endif /* HAVE_WCSNCMP */ |
| } |
| +#endif /* !__MIDIPIX__ */ |
| |
| size_t |
| SDL_strlcpy(SDL_OUT_Z_CAP(maxlen) char *dst, const char *src, size_t maxlen) |