19 #ifndef TESSERACT_TRAINING_UTIL_H_
20 #define TESSERACT_TRAINING_UTIL_H_
34 const uint8_t* str = reinterpret_cast<const uint8_t*>(s.c_str());
35 for (
unsigned ch = 0; str[ch] != 0; ++ch) {
36 hash_code += str[ch] << (ch % 24);
41 #else // COMPILER_MSVC
42 struct StringHash :
public stdext::hash_compare <std::string> {
45 const uint8_t* str = reinterpret_cast<const uint8_t*>(s.c_str());
46 for (
unsigned ch = 0; str[ch] != 0; ++ch) {
47 hash_code += str[ch] << (ch % 24);
55 #endif // !COMPILER_MSVC
57 #ifdef GOOGLE_TESSERACT
58 #include "base/heap-checker.h"
59 #define DISABLE_HEAP_LEAK_CHECK HeapLeakChecker::Disabler disabler
61 #define DISABLE_HEAP_LEAK_CHECK {}
64 #endif // TESSERACT_TRAINING_UTIL_H_