| 1 | --- README.html.old 2018-02-15 18:46:13.000000000 +0100 |
| 2 | +++ README.html 2018-03-18 01:21:37.000000000 +0100 |
| 3 | @@ -499,7 +499,18 @@ that you are using the static makefiles |
| 4 | If you're building with the autoconf programs, these two functions are |
| 5 | automatically enabled if available. |
| 6 | |
| 7 | -3. Typedefs |
| 8 | +3. Runtime functions not available on all platforms |
| 9 | + |
| 10 | + Some functions are not available on all systems. One example of such a |
| 11 | + function is fstatat(). If possible, such functions will be replaced by |
| 12 | + wrappers, stubs or behavioral equivalent functions. By default, such |
| 13 | + functions are disabled; enable them by setting #define HAVE_FUNC 1 (in |
| 14 | + environ.h). |
| 15 | + |
| 16 | + If you're building with the autoconf or cmake programs, these functions are |
| 17 | + automatically enabled if available. |
| 18 | + |
| 19 | +4. Typedefs |
| 20 | |
| 21 | A deficiency of C is that no standard has been universally |
| 22 | adopted for typedefs of the built-in types. As a result, |
| 23 | @@ -542,7 +553,7 @@ that you are using the static makefiles |
| 24 | necessary we use the typedefs in stdint.h to specify the pointer |
| 25 | size (either 4 or 8 byte). |
| 26 | |
| 27 | -4. Compile-time control over stderr output (see environ.h) |
| 28 | +5. Compile-time control over stderr output (see environ.h) |
| 29 | |
| 30 | Leptonica provides both compile-time and run-time control over |
| 31 | messages and debug output (thanks to Dave Bryan). Both compile-time |
| 32 | @@ -553,7 +564,7 @@ that you are using the static makefiles |
| 33 | NO_CONSOLE_IO is defined on the compile line. For production code |
| 34 | where no output is to go to stderr, compile with -DNO_CONSOLE_IO. |
| 35 | |
| 36 | -5. In-memory raster format (Pix) |
| 37 | +6. In-memory raster format (Pix) |
| 38 | |
| 39 | Unlike many other open source packages, Leptonica uses packed |
| 40 | data for images with all bit/pixel (bpp) depths, allowing us |
| 41 | @@ -574,7 +585,7 @@ that you are using the static makefiles |
| 42 | and a DPix is provided for 2D arrays of doubles. Converters |
| 43 | between these and the Pix are given. |
| 44 | |
| 45 | -6. Conversion between Pix and other in-memory raster formats |
| 46 | +7. Conversion between Pix and other in-memory raster formats |
| 47 | |
| 48 | . If you use Leptonica with other imaging libraries, you will need |
| 49 | functions to convert between the Pix and other image data |
| 50 | @@ -583,7 +594,7 @@ that you are using the static makefiles |
| 51 | ordering and byte ordering on raster lines. See the file pix.h |
| 52 | for the specification of image data in the pix. |
| 53 | |
| 54 | -7. Custom memory management |
| 55 | +8. Custom memory management |
| 56 | |
| 57 | Leptonica allows you to use custom memory management (allocator, |
| 58 | deallocator). For Pix, which tend to be large, the alloc/dealloc |
| 59 | Only in leptonica-1.75.3: README.html.orig |
| 60 | --- cmake/Configure.cmake.old 2017-11-03 19:35:52.000000000 +0100 |
| 61 | +++ cmake/Configure.cmake 2018-03-18 01:21:37.000000000 +0100 |
| 62 | @@ -73,6 +73,7 @@ check_includes(include_files_list) |
| 63 | |
| 64 | set(functions_list |
| 65 | fmemopen |
| 66 | + fstatat |
| 67 | ) |
| 68 | check_functions(functions_list) |
| 69 | |
| 70 | --- configure.ac.old 2018-02-13 00:08:33.000000000 +0100 |
| 71 | +++ configure.ac 2018-03-18 01:21:37.000000000 +0100 |
| 72 | @@ -223,6 +223,7 @@ AC_LINK_IFELSE([AC_LANG_PROGRAM()], |
| 73 | |
| 74 | # Checks for library functions. |
| 75 | AC_CHECK_FUNCS([fmemopen]) |
| 76 | +AC_CHECK_FUNC([fstatat]) |
| 77 | |
| 78 | AC_CONFIG_FILES([Makefile src/endianness.h src/Makefile prog/Makefile lept.pc]) |
| 79 | AC_OUTPUT |
| 80 | --- cppan.yml.old 2017-03-10 20:57:34.000000000 +0100 |
| 81 | +++ cppan.yml 2018-03-18 01:21:37.000000000 +0100 |
| 82 | @@ -6,7 +6,9 @@ files: |
| 83 | include_directories: |
| 84 | public: src |
| 85 | |
| 86 | -check_function_exists: fmemopen |
| 87 | +check_function_exists: |
| 88 | + - fmemopen |
| 89 | + - fstatat |
| 90 | |
| 91 | check_include_exists: |
| 92 | - dlfcn.h |
| 93 | --- src/environ.h.old 2018-01-16 00:30:21.000000000 +0100 |
| 94 | +++ src/environ.h 2018-03-18 01:21:37.000000000 +0100 |
| 95 | @@ -127,6 +127,15 @@ typedef uintptr_t l_uintptr_t; |
| 96 | #define HAVE_FMEMOPEN 1 |
| 97 | #endif /* ! HAVE_CONFIG_H etc. */ |
| 98 | |
| 99 | +/* |
| 100 | + * fstatat() is defined by POSIX, but some systems do not support it. |
| 101 | + * One example is older macOS systems (pre-10.10). |
| 102 | + * Play it safe and set the default value to 0. |
| 103 | + */ |
| 104 | +#if !defined(HAVE_CONFIG_H) |
| 105 | +#define HAVE_FSTATAT 0 |
| 106 | +#endif /* ! HAVE_CONFIG_H */ |
| 107 | + |
| 108 | |
| 109 | /*--------------------------------------------------------------------* |
| 110 | * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!* |
| 111 | --- src/makefile.static.old 2018-02-13 02:40:04.000000000 +0100 |
| 112 | +++ src/makefile.static 2018-03-18 01:21:37.000000000 +0100 |
| 113 | @@ -49,6 +49,11 @@ |
| 114 | # The default is not to use, because they only work on linux. |
| 115 | # To use these, #define HAVE_FMEMOPEN to 1 in environ.h. |
| 116 | # |
| 117 | +# Customization for POSIX-compliant function fstatat(). |
| 118 | +# The default is not to use, because some systems do not |
| 119 | +# support it. |
| 120 | +# To use this, #define HAVE_FSTATAT to 1 in environ.h. |
| 121 | +# |
| 122 | # Customization for Cygwin: |
| 123 | # (1) Use the appropriate $CC |
| 124 | # |
| 125 | --- sw.cpp.old 2017-11-20 18:50:09.000000000 +0100 |
| 126 | +++ sw.cpp 2018-03-18 01:21:37.000000000 +0100 |
| 127 | @@ -56,6 +56,7 @@ void check(Checker &c) |
| 128 | { |
| 129 | auto &s = c.addSet("leptonica"); |
| 130 | s.checkFunctionExists("fmemopen"); |
| 131 | + s.checkFunctionExists("fstatat"); |
| 132 | s.checkIncludeExists("dlfcn.h"); |
| 133 | s.checkIncludeExists("inttypes.h"); |
| 134 | s.checkIncludeExists("memory.h"); |