ICU now uses namespaces. When trying to use the scrptrun.h header, the
header cannot compile stand-alone as it is inheriting from UObject which
is namespaced now. Add namespace macros to properly inherit.
ICU-20566 Add scrptrun to the extra high level Makefile
The scrptrun project was not being added to the extra portion of the ICU
build. Add it as a sub project so it can always be built.
ICU-20566 Properly namespace the ScriptRun test
The ScriptRun class is now namespaced. Update the test reference.
ICU-20566 Use int instead of void to compile
Clang will complain about having a void main without an int main to
invoke. Change void to int and return 0.
## Files to remove for 'make clean'
CLEANFILES = *~
-SUBDIRS = uconv
+SUBDIRS = scrptrun uconv
## List of phony targets
.PHONY : all all-local all-recursive install install-local \
#include "cmemory.h"
#include "scrptrun.h"
+U_NAMESPACE_BEGIN
+
const char ScriptRun::fgClassID=0;
UChar32 ScriptRun::pairedChars[] = {
return true;
}
+U_NAMESPACE_END
#include "unicode/uobject.h"
#include "unicode/uscript.h"
+U_NAMESPACE_BEGIN
+
struct ScriptRecord
{
UChar32 startChar;
reset(start, length);
}
+U_NAMESPACE_END
#endif
int32_t testLength = UPRV_LENGTHOF(testChars);
-void main()
+int main()
{
- ScriptRun scriptRun(testChars, 0, testLength);
+ icu::ScriptRun scriptRun(testChars, 0, testLength);
while (scriptRun.next()) {
int32_t start = scriptRun.getScriptStart();
printf("Script '%s' from %d to %d.\n", uscript_getName(code), start, end);
}
+ return 0;
}