Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit efcca8d

Browse files
authored
Merge pull request #27821 from DWesl/patch-5
BLD,Cygwin: Include Python.h first in various C++ files
2 parents 5a9916f + 66149ed commit efcca8d

File tree

7 files changed

+16
-10
lines changed

7 files changed

+16
-10
lines changed

.github/workflows/cygwin.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ jobs:
243243
shell: bash.exe -eo pipefail -o igncr "{0}"
244244
id: cygwin-run-pytest
245245
run: |
246-
xvfb-run pytest -rfEsXR -n auto \
246+
xvfb-run pytest-3.${{ matrix.python-minor-version }} -rfEsXR -n auto \
247247
--maxfail=50 --timeout=300 --durations=25 \
248248
--cov-report=xml --cov=lib --log-level=DEBUG --color=yes
249249

src/_backend_agg.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
#define NO_IMPORT_ARRAY
44

5+
#include <Python.h>
56
#include "_backend_agg.h"
67
#include "mplutils.h"
78

src/_c_internal_utils.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
#include <Python.h>
2+
/* Python.h must be included before any system headers,
3+
to ensure visibility macros are properly set. */
14
#include <stdexcept>
25

36
#ifdef _WIN32

src/_tkagg.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
// rewritten, we have removed the PIL licensing information. If you want PIL,
1010
// you can get it at https://python-pillow.org/
1111

12+
#include <Python.h>
1213
#include <memory>
1314
#include <new>
1415
#include <stdexcept>

src/_ttconv.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@
55
66
Python wrapper for TrueType conversion library in ../ttconv.
77
*/
8-
#include "mplutils.h"
9-
108
#include <pybind11/pybind11.h>
9+
#include "mplutils.h"
1110
#include "pprdrv.h"
1211
#include <vector>
1312

src/ft2font.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,13 @@
22

33
/* A python interface to FreeType */
44
#pragma once
5+
56
#ifndef MPL_FT2FONT_H
67
#define MPL_FT2FONT_H
8+
9+
#define PY_SSIZE_T_CLEAN
10+
#include <Python.h>
11+
712
#include <vector>
813
#include<set>
914
#include <stdint.h>
@@ -19,9 +24,6 @@ extern "C" {
1924
#include FT_TRUETYPE_TABLES_H
2025
}
2126

22-
#define PY_SSIZE_T_CLEAN
23-
#include <Python.h>
24-
2527
/*
2628
By definition, FT_FIXED as 2 16bit values stored in a single long.
2729
*/

src/numpy_cpp.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@
1414
* original.
1515
*/
1616

17-
#include "py_exceptions.h"
18-
19-
#include <complex>
20-
2117
#ifdef _POSIX_C_SOURCE
2218
# undef _POSIX_C_SOURCE
2319
#endif
@@ -40,6 +36,10 @@
4036
#include <Python.h>
4137
#include <numpy/ndarrayobject.h>
4238

39+
#include "py_exceptions.h"
40+
41+
#include <complex>
42+
4343
namespace numpy
4444
{
4545

0 commit comments

Comments
 (0)