Compatibility with Leptonica 1.73

http://www.leptonica.org/source/version-notes.html:
       Naming changes (to avoid collisions):
         #defines MALLOC --> LEPT_MALLOC, CALLOC --> LEPT_CALLOC, etc.
         ByteBuffer --> L_ByteBuffer

Introduction of the TESSERACT_LIBLEPT_PREREQ macro allows backward compatibility with Leptonica <1.73.
This commit is contained in:
Dennis Schridde 2016-01-31 12:13:22 +01:00
parent 1826ac140b
commit 6072814fea

View File

@ -19,6 +19,22 @@
#include <stdio.h> #include <stdio.h>
#include <mach/mach_time.h> #include <mach/mach_time.h>
#endif #endif
/*
Convenience macro to test the version of Leptonica.
*/
#if defined(LIBLEPT_MAJOR_VERSION) && defined(LIBLEPT_MINOR_VERSION)
# define TESSERACT_LIBLEPT_PREREQ(maj, min) \
((LIBLEPT_MAJOR_VERSION) > (maj) || ((LIBLEPT_MAJOR_VERSION) == (maj) && (LIBLEPT_MINOR_VERSION) >= (min)))
#else
# define TESSERACT_LIBLEPT_PREREQ(maj, min) 0
#endif
#if TESSERACT_LIBLEPT_PREREQ(1,73)
# define CALLOC LEPT_CALLOC
# define FREE LEPT_FREE
#endif
#ifdef USE_OPENCL #ifdef USE_OPENCL
#include "opencl_device_selection.h" #include "opencl_device_selection.h"