mirror of
https://github.com/slsdetectorgroup/aare.git
synced 2026-10-17 11:35:12 +02:00
Dev/win compile (#402)
Collection of fixes to make aare build on Windows. Requires the previous PRs for compilation to succeed. - Replaced `or` keyword with || - updated cmake file - fix for 32 bit long in fseek closes #395 closes #396
This commit is contained in:
@@ -124,7 +124,7 @@ void define_ClusterVector(py::module &m, const std::string &typestr) {
|
||||
.def_property_readonly(
|
||||
"fmt",
|
||||
[typestr](ClusterVector<ClusterType> &self) {
|
||||
return fmt_format<ClusterType>;
|
||||
return fmt_format<ClusterType>();
|
||||
},
|
||||
"PEP 3118 format string for one stored cluster.")
|
||||
|
||||
@@ -145,11 +145,11 @@ void define_ClusterVector(py::module &m, const std::string &typestr) {
|
||||
.def_buffer(
|
||||
[typestr](ClusterVector<ClusterType> &self) -> py::buffer_info {
|
||||
return py::buffer_info(
|
||||
self.data(), /* Pointer to buffer */
|
||||
self.item_size(), /* Size of one scalar */
|
||||
fmt_format<ClusterType>, /* Format descriptor */
|
||||
1, /* Number of dimensions */
|
||||
{self.size()}, /* Buffer dimensions */
|
||||
self.data(), /* Pointer to buffer */
|
||||
self.item_size(), /* Size of one scalar */
|
||||
fmt_format<ClusterType>(), /* Format descriptor */
|
||||
1, /* Number of dimensions */
|
||||
{self.size()}, /* Buffer dimensions */
|
||||
{self.item_size()} /* Strides (in bytes) for each index */
|
||||
);
|
||||
});
|
||||
|
||||
@@ -112,8 +112,13 @@ struct fmt_format_trait<Cluster<T, ClusterSizeX, ClusterSizeY, CoordType>> {
|
||||
}
|
||||
};
|
||||
|
||||
template <typename ClusterType>
|
||||
auto fmt_format = fmt_format_trait<ClusterType>::value();
|
||||
// Function-local static rather than a variable template: MSVC does not run
|
||||
// the dynamic initializer of a variable template instantiated from inside
|
||||
// another template, which left the format string empty.
|
||||
template <typename ClusterType> const std::string &fmt_format() {
|
||||
static const std::string value = fmt_format_trait<ClusterType>::value();
|
||||
return value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper function to allocate image data given item size and shape
|
||||
|
||||
Reference in New Issue
Block a user