Skip to content

Commit

Permalink
Remove macro USE_STD_NAMESPACE (#1360)
Browse files Browse the repository at this point in the history
The related code in training/util.h now uses the GOOGLE_TESSERACT macro
to enable Google specific code to disable heap checking.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
  • Loading branch information
stweil authored and zdenop committed Mar 4, 2018
1 parent 0d9cdbe commit 7972b13
Show file tree
Hide file tree
Showing 16 changed files with 17 additions and 22 deletions.
1 change: 0 additions & 1 deletion CMakeLists.txt
Expand Up @@ -131,7 +131,6 @@ include(SourceGroups)

add_definitions(-DHAVE_CONFIG_H)
add_definitions(-D_SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS=1)
add_definitions(-DUSE_STD_NAMESPACE=1)
add_definitions(-DWINDLLNAME="libtesseract${VERSION_MAJOR}${VERSION_MINOR}.dll")

include_directories(${Leptonica_INCLUDE_DIRS})
Expand Down
1 change: 0 additions & 1 deletion api/Makefile.am
@@ -1,5 +1,4 @@
AM_CPPFLAGS += -DLOCALEDIR=\"$(localedir)\"\
-DUSE_STD_NAMESPACE \
-I$(top_srcdir)/arch -I$(top_srcdir)/lstm \
-I$(top_srcdir)/ccutil -I$(top_srcdir)/ccstruct \
-I$(top_srcdir)/viewer \
Expand Down
2 changes: 1 addition & 1 deletion arch/Makefile.am
@@ -1,4 +1,4 @@
AM_CPPFLAGS += -I$(top_srcdir)/ccstruct -I$(top_srcdir)/ccutil -I$(top_srcdir)/viewer -DUSE_STD_NAMESPACE
AM_CPPFLAGS += -I$(top_srcdir)/ccstruct -I$(top_srcdir)/ccutil -I$(top_srcdir)/viewer
AUTOMAKE_OPTIONS = subdir-objects
SUBDIRS =
AM_CXXFLAGS =
Expand Down
1 change: 0 additions & 1 deletion ccmain/Makefile.am
@@ -1,5 +1,4 @@
AM_CPPFLAGS += \
-DUSE_STD_NAMESPACE \
-I$(top_srcdir)/ccutil -I$(top_srcdir)/ccstruct \
-I$(top_srcdir)/arch -I$(top_srcdir)/lstm \
-I$(top_srcdir)/viewer \
Expand Down
2 changes: 1 addition & 1 deletion ccstruct/Makefile.am
Expand Up @@ -2,7 +2,7 @@ AM_CPPFLAGS += \
-I$(top_srcdir)/ccutil -I$(top_srcdir)/cutil \
-I$(top_srcdir)/viewer \
-I$(top_srcdir)/opencl
AM_CPPFLAGS += $(OPENCL_CPPFLAGS) -DUSE_STD_NAMESPACE
AM_CPPFLAGS += $(OPENCL_CPPFLAGS)

if VISIBILITY
AM_CPPFLAGS += -DTESS_EXPORTS \
Expand Down
2 changes: 1 addition & 1 deletion ccutil/Makefile.am
@@ -1,7 +1,7 @@
AUTOMAKE_OPTIONS = subdir-objects
SUBDIRS =
AM_CXXFLAGS =
AM_CPPFLAGS = -DUSE_STD_NAMESPACE
AM_CPPFLAGS =

if !NO_TESSDATA_PREFIX
AM_CXXFLAGS += -DTESSDATA_PREFIX=@datadir@/
Expand Down
2 changes: 1 addition & 1 deletion classify/Makefile.am
@@ -1,7 +1,7 @@
AM_CPPFLAGS += \
-I$(top_srcdir)/cutil -I$(top_srcdir)/ccutil \
-I$(top_srcdir)/ccstruct -I$(top_srcdir)/dict \
-I$(top_srcdir)/viewer -DUSE_STD_NAMESPACE
-I$(top_srcdir)/viewer

if VISIBILITY
AM_CPPFLAGS += -DTESS_EXPORTS \
Expand Down
1 change: 0 additions & 1 deletion cppan.yml
Expand Up @@ -148,7 +148,6 @@ projects:
public:
- HAVE_CONFIG_H
- _SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS=1
- USE_STD_NAMESPACE=1
- WINDLLNAME="tesseract"
shared:
definitions:
Expand Down
2 changes: 1 addition & 1 deletion cutil/Makefile.am
@@ -1,4 +1,4 @@
AM_CPPFLAGS += -I$(top_srcdir)/ccutil -I$(top_srcdir)/viewer -DUSE_STD_NAMESPACE
AM_CPPFLAGS += -I$(top_srcdir)/ccutil -I$(top_srcdir)/viewer

if VISIBILITY
AM_CPPFLAGS += -DTESS_EXPORTS \
Expand Down
2 changes: 1 addition & 1 deletion dict/Makefile.am
@@ -1,5 +1,5 @@
AM_CPPFLAGS += -I$(top_srcdir)/cutil -I$(top_srcdir)/ccutil \
-I$(top_srcdir)/ccstruct -I$(top_srcdir)/viewer -DUSE_STD_NAMESPACE
-I$(top_srcdir)/ccstruct -I$(top_srcdir)/viewer

if VISIBILITY
AM_CPPFLAGS += -DTESS_EXPORTS \
Expand Down
10 changes: 5 additions & 5 deletions lstm/Makefile.am
@@ -1,7 +1,7 @@
AM_CPPFLAGS += \
-I$(top_srcdir)/ccutil -I$(top_srcdir)/cutil -I$(top_srcdir)/ccstruct \
-I$(top_srcdir)/arch -I$(top_srcdir)/viewer -I$(top_srcdir)/classify \
-I$(top_srcdir)/dict -I$(top_srcdir)/lstm -DUSE_STD_NAMESPACE
-I$(top_srcdir)/dict -I$(top_srcdir)/lstm
AUTOMAKE_OPTIONS = subdir-objects
SUBDIRS =
AM_CXXFLAGS = $(OPENMP_CXXFLAGS)
Expand All @@ -16,19 +16,19 @@ AM_CPPFLAGS += -DTESS_EXPORTS
endif

include_HEADERS = \
convolve.h ctc.h fullyconnected.h functions.h input.h \
convolve.h ctc.h fullyconnected.h functions.h input.h \
lstm.h lstmrecognizer.h lstmtrainer.h maxpool.h \
networkbuilder.h network.h networkio.h networkscratch.h \
parallel.h plumbing.h recodebeam.h reconfig.h reversed.h \
parallel.h plumbing.h recodebeam.h reconfig.h reversed.h \
series.h static_shape.h stridemap.h tfnetwork.h weightmatrix.h

noinst_HEADERS =

noinst_LTLIBRARIES = libtesseract_lstm.la

libtesseract_lstm_la_SOURCES = \
convolve.cpp ctc.cpp fullyconnected.cpp functions.cpp input.cpp \
convolve.cpp ctc.cpp fullyconnected.cpp functions.cpp input.cpp \
lstm.cpp lstmrecognizer.cpp lstmtrainer.cpp maxpool.cpp \
networkbuilder.cpp network.cpp networkio.cpp \
parallel.cpp plumbing.cpp recodebeam.cpp reconfig.cpp reversed.cpp \
parallel.cpp plumbing.cpp recodebeam.cpp reconfig.cpp reversed.cpp \
series.cpp stridemap.cpp tfnetwork.cpp weightmatrix.cpp
1 change: 0 additions & 1 deletion textord/Makefile.am
@@ -1,5 +1,4 @@
AM_CPPFLAGS += \
-DUSE_STD_NAMESPACE \
-I$(top_srcdir)/ccstruct -I$(top_srcdir)/ccutil \
-I$(top_srcdir)/viewer \
-I$(top_srcdir)/ccmain -I$(top_srcdir)/wordrec -I$(top_srcdir)/api \
Expand Down
2 changes: 1 addition & 1 deletion training/Makefile.am
@@ -1,6 +1,6 @@
AUTOMAKE_OPTIONS = subdir-objects
AM_CPPFLAGS += \
-DUSE_STD_NAMESPACE -DPANGO_ENABLE_ENGINE\
-DPANGO_ENABLE_ENGINE \
-I$(top_srcdir)/ccmain -I$(top_srcdir)/api \
-I$(top_srcdir)/ccutil -I$(top_srcdir)/ccstruct \
-I$(top_srcdir)/lstm -I$(top_srcdir)/arch \
Expand Down
2 changes: 1 addition & 1 deletion training/util.h
Expand Up @@ -55,7 +55,7 @@ struct StringHash : public stdext::hash_compare <std::string> {
};
#endif // !COMPILER_MSVC

#ifndef USE_STD_NAMESPACE
#ifdef GOOGLE_TESSERACT
#include "base/heap-checker.h"
#define DISABLE_HEAP_LEAK_CHECK HeapLeakChecker::Disabler disabler
#else
Expand Down
6 changes: 3 additions & 3 deletions unittest/Makefile.am
@@ -1,6 +1,6 @@
AUTOMAKE_OPTIONS = subdir-objects

AM_CPPFLAGS += -DUSE_STD_NAMESPACE -DPANGO_ENABLE_ENGINE
AM_CPPFLAGS += -DPANGO_ENABLE_ENGINE
AM_CPPFLAGS += -I$(top_srcdir)/api
AM_CPPFLAGS += -I$(top_srcdir)/arch
AM_CPPFLAGS += -I$(top_srcdir)/ccmain
Expand All @@ -14,7 +14,7 @@ AM_CPPFLAGS += -I$(top_srcdir)/lstm
AM_CPPFLAGS += -I$(top_srcdir)/textord
AM_CPPFLAGS += -I$(top_srcdir)/viewer
AM_CPPFLAGS += -I$(top_srcdir)/wordrec

# Build googletest:
check_LTLIBRARIES = libgtest.la libgtest_main.la
libgtest_la_SOURCES = ../googletest/googletest/src/gtest-all.cc
Expand All @@ -36,7 +36,7 @@ check_PROGRAMS = \
TESTS = $(check_PROGRAMS)

#List of source files needed to build the executable:

apiexample_test_SOURCES = apiexample_test.cc
apiexample_test_LDFLAGS = $(OPENCL_LDFLAGS) $(LEPTONICA_LIBS)
apiexample_test_LDADD = $(GTEST_LIBS) $(TESS_LIBS) $(LEPTONICA_LIBS)
Expand Down
2 changes: 1 addition & 1 deletion wordrec/Makefile.am
Expand Up @@ -2,7 +2,7 @@ AM_CPPFLAGS += \
-I$(top_srcdir)/ccstruct -I$(top_srcdir)/ccutil \
-I$(top_srcdir)/cutil -I$(top_srcdir)/classify \
-I$(top_srcdir)/dict \
-I$(top_srcdir)/viewer -DUSE_STD_NAMESPACE
-I$(top_srcdir)/viewer

if VISIBILITY
AM_CPPFLAGS += -DTESS_EXPORTS \
Expand Down

0 comments on commit 7972b13

Please sign in to comment.