Imaging.h: confusion with system

The file `libImaging/Imaging.h` gets installed flat on
Ubuntus into the public Python includes.

When building a newer version of Pillow from source and
hinting the Python includes "too early" in includes, e.g.
in package managers, this can confuse the two files and
pick up the external file over the internal one. With
different versions, this mismatch can lead to build errors,
e.g. undefined macros.

The most robust way to avoid this is to pre-fix the internal
include accordingly, so that the relative path to the including
file has to match as well.
This commit is contained in:
Axel Huebl 2020-09-15 22:10:28 -07:00 committed by Andrew Murray
parent b0fa0fd640
commit f79379ed7c
13 changed files with 13 additions and 13 deletions

View File

@ -88,7 +88,7 @@
#endif
#endif
#include "Imaging.h"
#include "libImaging/Imaging.h"
#define _USE_MATH_DEFINES
#include <math.h>

View File

@ -31,7 +31,7 @@ http://www.cazabon.com\n\
#include "datetime.h"
#include "lcms2.h"
#include "Imaging.h"
#include "libImaging/Imaging.h"
#define PYCMSVERSION "1.0.0 pil"

View File

@ -20,7 +20,7 @@
#define PY_SSIZE_T_CLEAN
#include "Python.h"
#include "Imaging.h"
#include "libImaging/Imaging.h"
#include <ft2build.h>
#include FT_FREETYPE_H

View File

@ -15,7 +15,7 @@
#include "Python.h"
#include "Imaging.h"
#include "libImaging/Imaging.h"
#include "math.h"
#include "float.h"

View File

@ -12,7 +12,7 @@
*/
#include "Python.h"
#include "Imaging.h"
#include "libImaging/Imaging.h"
#define LUT_SIZE (1<<9)

View File

@ -14,7 +14,7 @@
#include "Python.h"
#include "Imaging.h"
#include "libImaging/Imaging.h"
#include "_tkmini.h"

View File

@ -1,6 +1,6 @@
#define PY_SSIZE_T_CLEAN
#include <Python.h>
#include "Imaging.h"
#include "libImaging/Imaging.h"
#include <webp/encode.h>
#include <webp/decode.h>
#include <webp/types.h>

View File

@ -32,7 +32,7 @@
#define PY_SSIZE_T_CLEAN
#include "Python.h"
#include "Imaging.h"
#include "libImaging/Imaging.h"
#include "Gif.h"
#include "Raw.h"

View File

@ -25,7 +25,7 @@
#include "Python.h"
#include "Imaging.h"
#include "libImaging/Imaging.h"
/* -------------------------------------------------------------------- */
/* Windows DIB support */

View File

@ -25,7 +25,7 @@
#define PY_SSIZE_T_CLEAN
#include "Python.h"
#include "Imaging.h"
#include "libImaging/Imaging.h"
#include "Gif.h"
#ifdef HAVE_UNISTD_H

View File

@ -20,7 +20,7 @@
#include "Python.h"
#include "Imaging.h"
#include "libImaging/Imaging.h"
/* compatibility wrappers (defined in _imaging.c) */
extern int PyImaging_CheckBuffer(PyObject* buffer);

View File

@ -19,7 +19,7 @@
#include "Python.h"
#include "Imaging.h"
#include "libImaging/Imaging.h"
/* -------------------------------------------------------------------- */

View File

@ -27,7 +27,7 @@
#include "Python.h"
#include "Imaging.h"
#include "libImaging/Imaging.h"
#include <math.h>