Skip to content

Commit ddea230

Browse files
committed
Don't compute function tables at compile time with clang
The current code fails to compile with clang compilers on Linux and macOS. Signed-off-by: Stefan Weil <sw@weilnetz.de>
1 parent 3480f1e commit ddea230

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/lstm/functions.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
namespace tesseract {
2222

23-
#if __cplusplus < 201402 // C++11
23+
#if __cplusplus < 201402 || defined(__clang__) // C++11
2424

2525
double TanhTable[kTableSize];
2626
double LogisticTable[kTableSize];

src/lstm/functions.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ constexpr int kTableSize = 4096;
3535
// Scale factor for float arg to int index.
3636
constexpr double kScaleFactor = 256.0;
3737

38-
#if __cplusplus < 201402 // C++11
38+
#if __cplusplus < 201402 || defined(__clang__) // C++11
3939

4040
extern double TanhTable[];
4141
extern double LogisticTable[];

0 commit comments

Comments
 (0)