|
Line 0
Link Here
|
|
|
1 |
--- sys/melder.h.orig 2015-03-22 17:29:26 UTC |
| 2 |
+++ sys/melder.h |
| 3 |
@@ -51,6 +51,8 @@ |
| 4 |
#define INT54_MIN -9007199254740991LL |
| 5 |
#endif |
| 6 |
|
| 7 |
+#include <uchar.h> |
| 8 |
+ |
| 9 |
typedef wchar_t wchar; |
| 10 |
typedef uint8_t char8_t; |
| 11 |
typedef char32_t char32; |
| 12 |
@@ -222,7 +224,7 @@ static inline int64_t str16len (const ch |
| 13 |
return (int64_t) wcslen ((const wchar_t *) string); |
| 14 |
} else { |
| 15 |
int64_t result = 0; |
| 16 |
- while (* string ++ != u'\0') result ++; |
| 17 |
+ while (* string ++ != (char16_t)'\0') result ++; |
| 18 |
return result; |
| 19 |
} |
| 20 |
} |
| 21 |
@@ -230,8 +232,8 @@ static inline void str16cpy (char16_t *t |
| 22 |
if (sizeof (wchar_t) == 2) { |
| 23 |
wcscpy ((wchar_t *) target, (const wchar_t *) source); |
| 24 |
} else { |
| 25 |
- while (* source != u'\0') * target ++ = * source ++; |
| 26 |
- * target = u'\0'; |
| 27 |
+ while (* source != (char16_t)'\0') * target ++ = * source ++; |
| 28 |
+ * target = (char16_t)'\0'; |
| 29 |
} |
| 30 |
} |
| 31 |
static inline int str16cmp (const char16_t *string1, const char16_t *string2) { |
| 32 |
@@ -239,7 +241,7 @@ static inline int str16cmp (const char16 |
| 33 |
return wcscmp ((const wchar_t *) string1, (const wchar_t *) string2); |
| 34 |
} else { |
| 35 |
while (*string1 == *string2 ++) { |
| 36 |
- if (*string1 ++ == u'\0') { |
| 37 |
+ if (*string1 ++ == (char16_t)'\0') { |
| 38 |
return 0; |
| 39 |
} |
| 40 |
} |
| 41 |
@@ -251,7 +253,7 @@ static inline int64_t str32len (const ch |
| 42 |
return (int64_t) wcslen ((const wchar_t *) string); |
| 43 |
} else { |
| 44 |
int64_t result = 0; |
| 45 |
- while (* string ++ != U'\0') result ++; |
| 46 |
+ while (* string ++ != (char32_t)'\0') result ++; |
| 47 |
return result; |
| 48 |
} |
| 49 |
} |
| 50 |
@@ -259,8 +261,8 @@ static inline void str32cpy (char32_t *t |
| 51 |
if (sizeof (wchar_t) == 4) { |
| 52 |
wcscpy ((wchar_t *) target, (const wchar_t *) source); |
| 53 |
} else { |
| 54 |
- while (* source != U'\0') * target ++ = * source ++; |
| 55 |
- * target = U'\0'; |
| 56 |
+ while (* source != (char32_t)'\0') * target ++ = * source ++; |
| 57 |
+ * target = (char32_t)'\0'; |
| 58 |
} |
| 59 |
} |
| 60 |
static inline int str32cmp (const char32_t *string1, const char32_t *string2) { |
| 61 |
@@ -268,7 +270,7 @@ static inline int str32cmp (const char32 |
| 62 |
return wcscmp ((const wchar_t *) string1, (const wchar_t *) string2); |
| 63 |
} else { |
| 64 |
while (*string1 == *string2 ++) { |
| 65 |
- if (*string1 ++ == U'\0') { |
| 66 |
+ if (*string1 ++ == (char32_t)'\0') { |
| 67 |
return 0; |
| 68 |
} |
| 69 |
} |
| 70 |
@@ -1171,6 +1173,11 @@ public: |
| 71 |
Melder_fclose (file, tmp); |
| 72 |
} |
| 73 |
} |
| 74 |
+ // operator () is not working in Sound_files.cpp:226 for some reason |
| 75 |
+ FILE * get_ptr(void) |
| 76 |
+ { |
| 77 |
+ return ptr; |
| 78 |
+ } |
| 79 |
}; |
| 80 |
|
| 81 |
class autoMelderFile { |