mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2024-12-01 07:59:05 +08:00
Correctly use DEBUG macro. C++ compilers do not define it. Instead they define NDEBUG in optimized compilations.
This commit is contained in:
parent
ff1a995bfc
commit
4ddc919ed0
@ -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.
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user