libexttextcat: fix the --with-system case too...

... by introducing a version check that is so horribly ugly that it will
hopefully be removed again as soon as a new upstream release with the
rename is available.

Change-Id: I8e0409ba7331dec7140d2a4a49720c804e90582f
This commit is contained in:
Michael Stahl 2013-03-25 19:09:50 +01:00
parent f8a3582d4c
commit a81f44c707
3 changed files with 27 additions and 0 deletions

View file

@ -1,3 +1,18 @@
diff -ur exttextcat.old/configure exttextcat/configure
--- exttextcat.old/configure 2012-06-28 10:17:56.000000000 +0200
+++ exttextcat/configure 2013-03-25 18:58:00.520816594 +0100
@@ -11776,9 +11776,9 @@
EXTTEXTCAT_MINOR_VERSION=4
-EXTTEXTCAT_MICRO_VERSION=0
+EXTTEXTCAT_MICRO_VERSION=1
-EXTTEXTCAT_VERSION=3.4.0
+EXTTEXTCAT_VERSION=3.4.1
ac_config_files="$ac_config_files libexttextcat.pc Makefile langclass/Makefile langclass/LM/Makefile langclass/ShortTexts/Makefile src/Makefile src/exttextcat-version.h src/test-primary.sh src/test-secondary.sh"
diff -ur exttextcat.old/src/textcat.c exttextcat/src/textcat.c
--- exttextcat.old/src/textcat.c 2012-11-01 15:40:35.000000000 +0100
+++ exttextcat/src/textcat.c 2013-03-25 16:22:57.226896529 +0100

View file

@ -57,9 +57,16 @@ Guess::Guess(const char * guess_str)
// &&
// strncmp((const char*)(guess_str + 1), _TEXTCAT_RESULT_SHORT, strlen(_TEXTCAT_RESULT_SHORT)) != 0)
// {
// FIXME just a temporary check until new version with renamed macros deployed
#if EXTTEXTCAT_VERSION_MAJOR > 3 || (EXTTEXTCAT_VERSION_MAJOR == 3 && (EXTTEXTCAT_VERSION_MINOR > 4 || (EXTTEXTCAT_VERSION_MINOR == 4 && (EXTTEXTCAT_VERSION_MICRO >= 1))))
if(strcmp((const char*)(guess_str + 1), TEXTCAT_RESULT_UNKNOWN_STR) != 0
&&
strcmp((const char*)(guess_str + 1), TEXTCAT_RESULT_SHORT_STR) != 0)
#else
if(strcmp((const char*)(guess_str + 1), _TEXTCAT_RESULT_UNKNOWN) != 0
&&
strcmp((const char*)(guess_str + 1), _TEXTCAT_RESULT_SHORT) != 0)
#endif
{
int current_pointer = 0;

View file

@ -128,7 +128,12 @@ vector<Guess> SimpleGuesser::GuessLanguage(const char* text)
const char *guess_list = textcat_Classify(h, text, len);
// FIXME just a temporary check until new version with renamed macros deployed
#if EXTTEXTCAT_VERSION_MAJOR > 3 || (EXTTEXTCAT_VERSION_MAJOR == 3 && (EXTTEXTCAT_VERSION_MINOR > 4 || (EXTTEXTCAT_VERSION_MINOR == 4 && (EXTTEXTCAT_VERSION_MICRO >= 1))))
if (strcmp(guess_list, TEXTCAT_RESULT_SHORT_STR) == 0)
#else
if (strcmp(guess_list, _TEXTCAT_RESULT_SHORT) == 0)
#endif
return guesses;
int current_pointer = 0;