Skip to content

Commit

Permalink
Fix build with legacy engine disabled (part 2)
Browse files Browse the repository at this point in the history
The functions TessBaseAPIInitLangMod, TessBaseAPIClearAdaptiveClassifier
and TessBaseAPIDetectOrientationScript need conditional compilation.

Signed-off-by: Stefan Weil <[email protected]>
  • Loading branch information
stweil committed Jul 4, 2018
1 parent 081793f commit 60fcff5
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/api/capi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -299,10 +299,12 @@ TESS_API char** TESS_CALL TessBaseAPIGetAvailableLanguagesAsVector(const TessBas
return arr;
}

#ifndef DISABLED_LEGACY_ENGINE
TESS_API int TESS_CALL TessBaseAPIInitLangMod(TessBaseAPI* handle, const char* datapath, const char* language)
{
return handle->InitLangMod(datapath, language);
}
#endif

TESS_API void TESS_CALL TessBaseAPIInitForAnalysePage(TessBaseAPI* handle)
{
Expand Down Expand Up @@ -336,10 +338,12 @@ TESS_API char* TESS_CALL TessBaseAPIRect(TessBaseAPI* handle, const unsigned cha
return handle->TesseractRect(imagedata, bytes_per_pixel, bytes_per_line, left, top, width, height);
}

#ifndef DISABLED_LEGACY_ENGINE
TESS_API void TESS_CALL TessBaseAPIClearAdaptiveClassifier(TessBaseAPI* handle)
{
handle->ClearAdaptiveClassifier();
}
#endif

TESS_API void TESS_CALL TessBaseAPISetImage(TessBaseAPI* handle, const unsigned char* imagedata, int width, int height,
int bytes_per_pixel, int bytes_per_line)
Expand Down Expand Up @@ -543,6 +547,8 @@ TESS_API BOOL TESS_CALL TessBaseAPIDetectOS(TessBaseAPI* handle, OSResults* resu
return FALSE; // Unsafe ABI, return FALSE always
}

#ifndef DISABLED_LEGACY_ENGINE

TESS_API BOOL TESS_CALL TessBaseAPIDetectOrientationScript(TessBaseAPI* handle,
int* orient_deg, float* orient_conf, const char** script_name, float* script_conf)
{
Expand All @@ -551,8 +557,6 @@ TESS_API BOOL TESS_CALL TessBaseAPIDetectOrientationScript(TessBaseAPI* handle,
return (BOOL)success;
}

#ifndef DISABLED_LEGACY_ENGINE

TESS_API void TESS_CALL TessBaseAPIGetFeaturesForBlob(TessBaseAPI* handle, TBLOB* blob, INT_FEATURE_STRUCT* int_features,
int* num_features, int* FeatureOutlineIndex)
{
Expand Down

0 comments on commit 60fcff5

Please sign in to comment.