Backport of https://code.qt.io/cgit/pyside/pyside-setup.git/commit/?id=1422cf4a7f277fb13fd209f24a90d6c02641497d.
From 1422cf4a7f277fb13fd209f24a90d6c02641497d Mon Sep 17 00:00:00 2001
From: Friedemann Kleint <Friedemann.Kleint@qt.io>
Date: Thu, 23 Jun 2022 10:44:01 +0200
Subject: libshiboken: Fix build with numpy 1.23.0
Pick-to: 6.3 6.2 5.15
Change-Id: I885c332d6c948820140946c73ae1926e88834143
Reviewed-by: Christian Tismer <tismer@stackless.com>
old
|
new
|
std::ostream &operator<<(std::ostream &str, PyArrayObject *o) |
116 | 116 | str << " NPY_ARRAY_NOTSWAPPED"; |
117 | 117 | if ((flags & NPY_ARRAY_WRITEABLE) != 0) |
118 | 118 | str << " NPY_ARRAY_WRITEABLE"; |
119 | | if ((flags & NPY_ARRAY_UPDATEIFCOPY) != 0) |
120 | | str << " NPY_ARRAY_UPDATEIFCOPY"; |
| 119 | #if NPY_VERSION >= 0x00000010 // NPY_1_23_API_VERSION |
| 120 | if ((flags & NPY_ARRAY_WRITEBACKIFCOPY) != 0) |
| 121 | str << " NPY_ARRAY_WRITEBACKIFCOPY"; |
| 122 | #else |
| 123 | if ((flags & NPY_ARRAY_UPDATEIFCOPY) != 0) |
| 124 | str << " NPY_ARRAY_UPDATEIFCOPY"; |
| 125 | #endif |
121 | 126 | } else { |
122 | 127 | str << '0'; |
123 | 128 | } |