Skip to content

Commit

Permalink
Compatibility with Leptonica 1.73
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
devurandom committed Jan 31, 2016
1 parent 1826ac1 commit 6072814
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions opencl/openclwrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,22 @@
#include <stdio.h>
#include <mach/mach_time.h>
#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

#include "opencl_device_selection.h"
Expand Down

0 comments on commit 6072814

Please sign in to comment.