mirror of
https://github.com/rhasspy/espeak-ng.git
synced 2026-11-04 06:32:20 +00:00
Remove definitions for towlower/towupper
The definitions for towlower() and towupper() are defined in /usr/include/wctype.h on FreeBSD platforms. I just removed the define and used the ucd_ equivilent where towlower/towupper were found.
/bin/sh ./libtool --tag=CC --mode=compile cc -DHAVE_CONFIG_H -I. -fPIC -fvisibility=hidden -pedantic -fno-exceptions -D PATH_ESPEAK_DATA=\"/usr/local/share/espeak-
ng-data\" -DLIBESPEAK_NG_EXPORT -Isrc/include -Isrc/include/compat -I src/ucd-tools/src/include -D_BSD_SOURCE -D_DEFAULT_SOURCE -D_POSIX_C_SOURCE=200112L -Wno-endif-lab
els -g -O2 -std=c99 -MT src/libespeak-ng/src_libespeak_ng_la-readclause.lo -MD -MP -MF src/libespeak-ng/.deps/src_libespeak_ng_la-readclause.Tpo -c -o src/libespeak-n
g/src_libespeak_ng_la-readclause.lo `test -f 'src/libespeak-ng/readclause.c' || echo './'`src/libespeak-ng/readclause.c
libtool: compile: cc -DHAVE_CONFIG_H -I. -fPIC -fvisibility=hidden -pedantic -fno-exceptions -D PATH_ESPEAK_DATA=\"/usr/local/share/espeak-ng-data\" -DLIBESPEAK_NG_EXPO
RT -Isrc/include -Isrc/include/compat -I src/ucd-tools/src/include -D_BSD_SOURCE -D_DEFAULT_SOURCE -D_POSIX_C_SOURCE=200112L -Wno-endif-labels -g -O2 -std=c99 -MT src/li
bespeak-ng/src_libespeak_ng_la-readclause.lo -MD -MP -MF src/libespeak-ng/.deps/src_libespeak_ng_la-readclause.Tpo -c src/libespeak-ng/readclause.c -fPIC -DPIC -o src/l
ibespeak-ng/.libs/src_libespeak_ng_la-readclause.o
In file included from src/libespeak-ng/readclause.c:32:
In file included from src/include/compat/wctype.h:30:
/usr/include/wctype.h:73:8: error: conflicting types for 'ucd_tolower'
wint_t towlower(wint_t);
^
src/include/compat/wchar.h:37:18: note: expanded from macro 'towlower'
^
src/ucd-tools/src/include/ucd/ucd.h:503:13: note: previous declaration is here
codepoint_t ucd_tolower(codepoint_t c);
^
In file included from src/libespeak-ng/readclause.c:32:
In file included from src/include/compat/wctype.h:30:
/usr/include/wctype.h:74:8: error: conflicting types for 'ucd_toupper'
wint_t towupper(wint_t);
^
src/include/compat/wchar.h:38:18: note: expanded from macro 'towupper'
^
src/ucd-tools/src/include/ucd/ucd.h:491:13: note: previous declaration is here
codepoint_t ucd_toupper(codepoint_t c);
^
src/libespeak-ng/readclause.c:366:19: warning: implicit declaration of function 'mkstemp' is invalid in C99 [-Wimplicit-function-declaration]
if ((fd_temp = mkstemp(fname_temp)) >= 0)
^
1 warning and 2 errors generated.
This commit is contained in:
@@ -32,7 +32,4 @@
|
||||
|
||||
#include <ucd/ucd.h>
|
||||
|
||||
#define towlower ucd_tolower
|
||||
#define towupper ucd_toupper
|
||||
|
||||
#endif
|
||||
|
||||
@@ -163,7 +163,7 @@ int towlower2(unsigned int c)
|
||||
if (c == 'I' && translator->langopts.dotless_i)
|
||||
return 0x131; // I -> ı
|
||||
|
||||
return towlower(c);
|
||||
return ucd_tolower(c);
|
||||
}
|
||||
|
||||
static int IsRomanU(unsigned int c)
|
||||
@@ -842,7 +842,7 @@ static int attrnumber(const wchar_t *pw, int default_value, int type)
|
||||
|
||||
while (IsDigit09(*pw))
|
||||
value = value*10 + *pw++ - '0';
|
||||
if ((type == 1) && (towlower(*pw) == 's')) {
|
||||
if ((type == 1) && (ucd_tolower(*pw) == 's')) {
|
||||
// time: seconds rather than ms
|
||||
value *= 1000;
|
||||
}
|
||||
|
||||
@@ -1791,13 +1791,13 @@ static int SubstituteChar(Translator *tr, unsigned int c, unsigned int next_in,
|
||||
// don't convert the case of the second character unless the next letter is also upper case
|
||||
c2 = new_c >> 16;
|
||||
if (upper_case && iswupper(next_in))
|
||||
c2 = towupper(c2);
|
||||
c2 = ucd_toupper(c2);
|
||||
*insert = c2;
|
||||
new_c &= 0xffff;
|
||||
}
|
||||
|
||||
if (upper_case)
|
||||
new_c = towupper(new_c);
|
||||
new_c = ucd_toupper(new_c);
|
||||
|
||||
*wordflags |= FLAG_CHAR_REPLACED;
|
||||
return new_c;
|
||||
|
||||
@@ -178,7 +178,7 @@ void uprintf(FILE *out, codepoint_t c, const char *format)
|
||||
uprintf_is(out, c, *++format);
|
||||
break;
|
||||
case 'L': /* lowercase */
|
||||
uprintf_codepoint(out, towlower(c), *++format);
|
||||
uprintf_codepoint(out, ucd_tolower(c), *++format);
|
||||
break;
|
||||
case 's': /* script */
|
||||
fputs(ucd_get_script_string(ucd_lookup_script(c)), out);
|
||||
@@ -187,7 +187,7 @@ void uprintf(FILE *out, codepoint_t c, const char *format)
|
||||
uprintf_codepoint(out, ucd_totitle(c), *++format);
|
||||
break;
|
||||
case 'U': /* uppercase */
|
||||
uprintf_codepoint(out, towupper(c), *++format);
|
||||
uprintf_codepoint(out, ucd_toupper(c), *++format);
|
||||
break;
|
||||
}
|
||||
++format;
|
||||
|
||||
Reference in New Issue
Block a user