提交 c400bdff 编写于 作者: Z Zdenko Podobný

Merge branch 'abi_comp' into 4.1

* abi_comp:
  restore CatchSignals to fix API compatibility
  fix build
......@@ -253,6 +253,25 @@ size_t TessBaseAPI::getOpenCLDevice(void **data) {
return 0;
}
/**
* Writes the thresholded image to stderr as a PBM file on receipt of a
* SIGSEGV, SIGFPE, or SIGBUS signal. (Linux/Unix only).
*/
void TessBaseAPI::CatchSignals() {
#ifdef __linux__
struct sigaction action;
memset(&action, 0, sizeof(action));
action.sa_handler = &signal_exit;
action.sa_flags = SA_RESETHAND;
sigaction(SIGSEGV, &action, nullptr);
sigaction(SIGFPE, &action, nullptr);
sigaction(SIGBUS, &action, nullptr);
#else
// Warn API users that an implementation is needed.
tprintf("CatchSignals has no non-linux implementation!\n");
#endif
}
/**
* Set the name of the input file. Needed only for training and
* loading a UNLV zone file.
......
......@@ -107,6 +107,12 @@ class TESS_API TessBaseAPI {
*/
static size_t getOpenCLDevice(void **device);
/**
* Writes the thresholded image to stderr as a PBM file on receipt of a
* SIGSEGV, SIGFPE, or SIGBUS signal. (Linux/Unix only).
*/
static void CatchSignals();
/**
* Set the name of the input file. Needed for training and
* reading a UNLV zone file, and for searchable PDF output.
......
......@@ -61,6 +61,19 @@
#include "errcode.h" // for ASSERT_HOST
#include "structures.h"
/**********************************************************************
* c o p y f i r s t
*
* Do the appropriate kind a push operation to copy the first node from
* one list to another.
*
**********************************************************************/
#define copy_first(l1,l2) \
(l2=push(l2, first_node(l1)))
/*----------------------------------------------------------------------
F u n c t i o n s
----------------------------------------------------------------------*/
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册