Skip to content

Commit

Permalink
Change check_python_version call according to changes in c2py
Browse files Browse the repository at this point in the history
  • Loading branch information
parcollet committed Aug 2, 2024
1 parent 8d1f024 commit f571aba
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/clu/misc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ namespace clu {
// Extract the name of a TemplateArgument. It is a bit tricky, so worth a function
//
str_t get_name_of_TemplateArgument(clang::TemplateArgument const &a, clang::ASTContext const *ctx);

// ---------- get_source_range_as_string ---------------------------
// Given a source range, grab it as a string
inline str_t get_source_range_as_string(clang::SourceRange const &sr, clang::ASTContext const *ctx) {
return clang::Lexer::getSourceText(clang::CharSourceRange::getTokenRange(sr), ctx->getSourceManager(), ctx->getLangOpts()).str();
Expand Down
3 changes: 2 additions & 1 deletion src/plugins/c2py/codegen/fnt.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include <algorithm>
#include <numeric>
#include "./fnt.hpp"
#include "data.hpp"
#include <fmt/core.h>
#include <fmt/format.h>
using namespace fmt::literals;
Expand Down Expand Up @@ -121,7 +122,7 @@ void codegen::write_dispatch(std::ostream &code, std::ostream &table, std::ostre
static auto const fun_{} = c2py::dispatcher_f_kw_t{{ )RAW",
pyname, fun_counter);

auto l = [&enforce_method, parent_class](auto &f_info) {
auto l = [&enforce_method, parent_class](fnt_info_t const &f_info) {
auto *f = f_info.ptr;
auto *m = llvm::dyn_cast_or_null<clang::CXXMethodDecl>(f);
auto args = fnt_params_with_default(f);
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/c2py/codegen/module.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ static struct PyModuleDef module_def = {{
extern "C" __attribute__((visibility("default"))) PyObject *PyInit_{modulename}() {{
if (not c2py::check_python_version()) return NULL;
if (not c2py::check_python_version("{modulename}")) return NULL;
// import numpy iff 'numpy/arrayobject.h' included
#ifdef Py_ARRAYOBJECT_H
Expand Down

0 comments on commit f571aba

Please sign in to comment.