Skip to content

Commit

Permalink
Fix ODR by making them inline
Browse files Browse the repository at this point in the history
  • Loading branch information
cyyever committed Nov 4, 2023
1 parent b26fe66 commit d4b5218
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions include/pybind11/numpy.h
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ struct npy_api {
int len;
};

static npy_api &get() {
static inline npy_api &get() {
PYBIND11_CONSTINIT static gil_safe_call_once_and_store<npy_api> storage;
return storage.call_once_and_store_result(lookup).get_stored();
}
Expand Down Expand Up @@ -646,7 +646,7 @@ class dtype : public object {
char flags() const { return detail::array_descriptor_proxy(m_ptr)->flags; }

private:
static object &_dtype_from_pep3118() {
static inline object &_dtype_from_pep3118() {
PYBIND11_CONSTINIT static gil_safe_call_once_and_store<object> storage;
return storage
.call_once_and_store_result([]() {
Expand Down
2 changes: 1 addition & 1 deletion include/pybind11/options.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class options {
// docstrings.
};

static state &global_state() {
static inline state &global_state() {
static state instance;
return instance;
}
Expand Down

0 comments on commit d4b5218

Please sign in to comment.