Correctly use DEBUG macro. C++ compilers do not define it. Instead they define NDEBUG in optimized compilations.

This commit is contained in:
Egor Pugin 2020-12-31 02:50:07 +03:00
parent ff1a995bfc
commit 4ddc919ed0
4 changed files with 5 additions and 5 deletions

View File

@ -205,7 +205,7 @@ TessBaseAPI::TessBaseAPI()
rect_height_(0),
image_width_(0),
image_height_(0) {
#if defined(DEBUG)
#if !defined(NDEBUG)
// The Tesseract executables would use the "C" locale by default,
// but other software which is linked against the Tesseract library
// typically uses the locale from the user's environment.

View File

@ -634,7 +634,7 @@ bool TessPDFRenderer::BeginDocumentHandler() {
if (size) {
font = buffer.data();
} else {
#if defined(DEBUG)
#if !defined(NDEBUG)
tprintf("Cannot open file \"%s\"!\nUsing internal glyphless font.\n",
stream.str().c_str());
#endif

View File

@ -627,7 +627,7 @@ int main(int argc, char** argv) {
static std::vector<std::string> vars_vec;
static std::vector<std::string> vars_values;
#if !defined(DEBUG)
#if defined(NDEBUG)
// Disable debugging and informational messages from Leptonica.
setMsgSeverity(L_SEVERITY_ERROR);
#endif

View File

@ -83,7 +83,7 @@ bool TessdataManager::LoadArchiveFile(const char *filename) {
}
}
result = is_loaded_;
#if defined(DEBUG)
#if !defined(NDEBUG)
} else {
tprintf("archive_read_open_filename(...,%s,...) failed, %s\n",
filename, strerror(archive_errno(a)));
@ -309,7 +309,7 @@ bool TessdataManager::TessdataTypeFromFileSuffix(const char *suffix,
return true;
}
}
#if defined(DEBUG)
#if !defined(NDEBUG)
tprintf("TessdataManager can't determine which tessdata"
" component is represented by %s\n", suffix);
#endif