diff options
-rw-r--r-- | doc/release/2.0.0-notes.rst | 2 | ||||
-rw-r--r-- | tools/replace_old_macros.sed | 12 |
2 files changed, 12 insertions, 2 deletions
diff --git a/doc/release/2.0.0-notes.rst b/doc/release/2.0.0-notes.rst index cbb77243f..defdc9c00 100644 --- a/doc/release/2.0.0-notes.rst +++ b/doc/release/2.0.0-notes.rst @@ -185,7 +185,7 @@ similar for PyArray_Descr* and other core objects in the future as preparation for NumPy 2.0. The macros in old_defines.h are deprecated and will be removed in the next -major release. The sed script tools/replace_old_macros.sed can be used to +minor release (>= 1.8). The sed script tools/replace_old_macros.sed can be used to replace these macros with the newer versions. You can test your code against the deprecated C API by #defining diff --git a/tools/replace_old_macros.sed b/tools/replace_old_macros.sed index 5d408adfb..d8f10909a 100644 --- a/tools/replace_old_macros.sed +++ b/tools/replace_old_macros.sed @@ -1,5 +1,15 @@ # Replaces the macros in old_defines.h by current versions -# Can be run as sed -i -f replace_old_macros.sed <file-paths> +# Can be run as +# +# sed -i -f replace_old_macros.sed <file-paths> +# +# or +# +# find . -name '*.[c,h]' -exec sed -i -f replace_old_macros.sed {} + ; +# +# This script is pretty reliable, but the diff should still +# be checked after running it to make sure that nothing untoward +# went down. s/\bNDARRAY_VERSION\b/NPY_VERSION/g s/\bPyArray_MIN_BUFSIZE\b/NPY_MIN_BUFSIZE/g s/\bPyArray_MAX_BUFSIZE\b/NPY_MAX_BUFSIZE/g |