Skip to content

Commit

Permalink
ABI compat
Browse files Browse the repository at this point in the history
  • Loading branch information
hobu committed Jun 18, 2024
1 parent 83158ff commit 066ab0c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ dependencies = [
"numpy >= 1.22"
]

version="1.5.1"
version="1.5.2"

[project.optional-dependencies]
test = [ ]
Expand Down
4 changes: 4 additions & 0 deletions src/pdal/io/NumpyReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@

#include "../plang/Environment.hpp"

#if NPY_ABI_VERSION < 0x02000000
#define PyDataType_FIELDS(descr) ((descr)->fields)
#define PyDataType_ELSIZE(descr) ((descr)->elsize)
#endif

std::string toString(PyObject *pname)
{
Expand Down
5 changes: 5 additions & 0 deletions src/pdal/plang/Invocation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,11 @@ bool Invocation::execute(PointViewPtr& v, MetadataNode stageMetadata)
}


#if NPY_ABI_VERSION < 0x02000000
#define PyDataType_FIELDS(descr) ((descr)->fields)
#define PyDataType_ELSIZE(descr) ((descr)->elsize)
#endif

// Returns a pointer to the data in Numpy array, 'array'.
void *Invocation::extractArray(PyObject *array, std::string const& name,
Dimension::Type t, size_t& num_elements)
Expand Down

0 comments on commit 066ab0c

Please sign in to comment.