mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2024-12-12 23:49:06 +08:00
IcuErrorCode: Define virtual destructor in .cpp file
This fixes compiler warnings from clang: src/training/icuerrorcode.h:44:7: warning: 'IcuErrorCode' has no out-of-line virtual method definitions; its vtable will be emitted in every translation unit [-Wweak-vtables] Signed-off-by: Stefan Weil <sw@weilnetz.de>
This commit is contained in:
parent
68bcd6ba90
commit
46d2273e82
@ -173,6 +173,7 @@ endif()
|
||||
########################################
|
||||
|
||||
set(unicharset_training_src
|
||||
icuerrorcode.cpp
|
||||
icuerrorcode.h
|
||||
lang_model_helpers.cpp
|
||||
lang_model_helpers.h
|
||||
|
@ -65,6 +65,7 @@ libtesseract_training_la_SOURCES = \
|
||||
commandlineflags.cpp \
|
||||
commontraining.cpp \
|
||||
degradeimage.cpp \
|
||||
icuerrorcode.cpp \
|
||||
lang_model_helpers.cpp \
|
||||
ligature_table.cpp \
|
||||
lstmtester.cpp \
|
||||
|
28
src/training/icuerrorcode.cpp
Normal file
28
src/training/icuerrorcode.cpp
Normal file
@ -0,0 +1,28 @@
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "icuerrorcode.h"
|
||||
|
||||
namespace tesseract {
|
||||
|
||||
// Destructor.
|
||||
// It is defined here, so the compiler can create a single vtable
|
||||
// instead of weak vtables in every compilation unit.
|
||||
IcuErrorCode::~IcuErrorCode() {
|
||||
if (isFailure()) {
|
||||
handleFailure();
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace tesseract.
|
@ -7,7 +7,7 @@
|
||||
*
|
||||
* Features:
|
||||
* - The constructor initializes the internal UErrorCode to U_ZERO_ERROR,
|
||||
* removing one common source of errors.
|
||||
* removing one common source of errors.
|
||||
* - Same use in C APIs taking a UErrorCode* (pointer) and C++ taking
|
||||
* UErrorCode& (reference), via conversion operators.
|
||||
* - Automatic checking for success when it goes out of scope. On failure,
|
||||
@ -44,11 +44,7 @@ namespace tesseract {
|
||||
class IcuErrorCode : public icu::ErrorCode {
|
||||
public:
|
||||
IcuErrorCode() {}
|
||||
virtual ~IcuErrorCode() {
|
||||
if (isFailure()) {
|
||||
handleFailure();
|
||||
}
|
||||
}
|
||||
virtual ~IcuErrorCode();
|
||||
|
||||
protected:
|
||||
virtual void handleFailure() const {
|
||||
|
Loading…
Reference in New Issue
Block a user