Skip to content

Commit 5297034

Browse files
committed
fix(manylinux): No views::zip in GCC 12
1 parent 069a1cb commit 5297034

File tree

4 files changed

+10
-38
lines changed

4 files changed

+10
-38
lines changed

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ target_link_libraries(velocem PRIVATE asio::asio llhttp::llhttp_static Python3::
3333
target_compile_features(velocem PRIVATE cxx_std_23)
3434
set_target_properties(velocem PROPERTIES CXX_VISIBILITY_PRESET hidden)
3535

36-
if(CMAKE_C_COMPILER_FRONTEND_VARIANT STREQUAL "GNU")
37-
target_compile_options(velocem PRIVATE "-Wall")
36+
if(WIN32)
37+
target_compile_definitions(velocem PRIVATE _WIN32_WINDOWS=0x0A00)
3838
endif()
3939

4040
add_subdirectory(src)

pyproject.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,6 @@ build_args = ["-j"]
3737
[tool.py-build-cmake.mac.cmake.options]
3838
"CMAKE_OSX_DEPLOYMENT_TARGET:STRING" = "10.15"
3939

40-
[tool.py-build-cmake.windows.cmake]
41-
args = ["-T", "ClangCL"]
42-
4340
[tool.py-build-cmake.windows.cmake.options]
4441
"VCPKG_TARGET_TRIPLET:STRING" = "x64-windows-static"
4542
"CMAKE_MSVC_RUNTIME_LIBRARY:STRING" = "MultiThreaded"

src/Balm.hpp

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -67,37 +67,6 @@ inline auto format_as(BalmStringView sv) {
6767
return std::string_view {sv._base.utf8, (std::size_t) sv._base.utf8_length};
6868
}
6969

70-
template <std::size_t N> struct BalmTuple {
71-
BalmTuple(std::function<void(BalmStringView*)> f_dealloc)
72-
: f_dealloc {f_dealloc} {
73-
static PyTypeObject type = []() {
74-
PyTypeObject ret = PyTuple_Type;
75-
ret.tp_new = nullptr;
76-
ret.tp_free = nullptr;
77-
ret.tp_dealloc = dealloc;
78-
return ret;
79-
}();
80-
}
81-
82-
private:
83-
union {
84-
PyTupleObject pyt_;
85-
struct {
86-
PyObject_VAR_HEAD;
87-
std::array<PyObject*, N> data;
88-
};
89-
};
90-
91-
const std::function<void(BalmTuple*)> f_dealloc;
92-
93-
static void dealloc(PyObject* self) {
94-
auto ptr {reinterpret_cast<BalmTuple*>(self)};
95-
for(auto pyobj : ptr->data)
96-
Py_DECREF(pyobj);
97-
ptr->f_dealloc(ptr);
98-
}
99-
};
100-
10170
} // namespace velocem
10271

10372
#endif // VELOCEM_GIL_BALM_H

src/ModVelocem.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,8 +223,14 @@ template <asio::execution::executor Ex> struct PythonApp {
223223

224224
PyDict_SetItem(env, gPO.proto, http_minor ? gPO.http11 : gPO.http10);
225225

226-
for(const auto& [hdr, val] : std::views::zip(req->headers, req->values))
227-
PyDict_SetItem(env, (PyObject*) &hdr.bsv, (PyObject*) &val);
226+
// Switch this when we get manylinux_2_34
227+
// for(const auto& [hdr, val] : std::views::zip(req->headers, req->values))
228+
// PyDict_SetItem(env, (PyObject*) &hdr.bsv, (PyObject*) &val);
229+
230+
for(size_t i {0}; i < req->headers.size(); ++i)
231+
PyDict_SetItem(env, (PyObject*) &req->headers[i].bsv,
232+
(PyObject*) &req->values[i]);
233+
228234

229235
replace_key(env, gPO.http_conlen, gPO.conlen);
230236
replace_key(env, gPO.http_contype, gPO.contype);

0 commit comments

Comments
 (0)