Skip to content

Commit d8a365e

Browse files
committed
Rework fwd.hpp - introduce macro to check for CXX20
Expose nanoeigenpy.__version__
1 parent d467536 commit d8a365e

File tree

3 files changed

+22
-3
lines changed

3 files changed

+22
-3
lines changed

include/nanoeigenpy/decompositions/sparse/SparseSolverBase.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/// Copyright 2025 INRIA
22
#pragma once
33

4+
#include "nanoeigenpy/fwd.hpp"
45
#include <Eigen/SparseCholesky>
56

67
namespace nanoeigenpy {

include/nanoeigenpy/fwd.hpp

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,22 @@
11
/// Copyright 2025 INRIA
22
#pragma once
33

4-
#define NANOEIGENPY_UNUSED_VARIABLE(var) (void)(var)
5-
#define NANOEIGENPY_UNUSED_TYPE(type) \
6-
NANOEIGENPY_UNUSED_VARIABLE((type *)(NULL))
4+
#if defined(__clang__)
5+
#define NANOEIGENPY_CLANG_COMPILER
6+
#elif defined(__GNUC__)
7+
#define NANOEIGENPY_GCC_COMPILER
8+
#elif defined(_MSC_VER)
9+
#define NANOEIGENPY_MSVC_COMPILER
10+
#endif
11+
12+
#if (__cplusplus >= 202002L || (defined(_MSVC_LAG) && _MSVC_LANG >= 202002L))
13+
#define NANOEIGENPY_WITH_CXX20_SUPPORT
14+
#endif
15+
16+
#include "nanoeigenpy/config.hpp"
17+
18+
#include <nanobind/nanobind.h>
19+
20+
namespace nanoeigenpy {
21+
namespace nb = nanobind;
22+
}

src/module.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,6 @@ NB_MODULE(nanoeigenpy, m) {
4646
exposeIsApprox<std::complex<double>>(m);
4747

4848
exposeComputationInfo(m);
49+
50+
m.attr("__version__") = NANOEIGENPY_VERSION;
4951
}

0 commit comments

Comments
 (0)