@@ -59,7 +59,7 @@ class loader_life_support {
59
59
60
60
// / This can only be used inside a pybind11-bound function, either by `argument_loader`
61
61
// / at argument preparation time or by `py::cast()` at execution time.
62
- PYBIND11_NOINLINE_DCL static void add_patient (handle h) {
62
+ PYBIND11_NOINLINE static void add_patient (handle h) {
63
63
auto &stack = get_internals ().loader_patient_stack ;
64
64
if (stack.empty ())
65
65
throw cast_error (" When called outside a bound function, py::cast() cannot "
@@ -86,7 +86,7 @@ class loader_life_support {
86
86
inline std::pair<decltype(internals::registered_types_py)::iterator, bool > all_type_info_get_cache (PyTypeObject *type);
87
87
88
88
// Populates a just-created cache entry.
89
- PYBIND11_NOINLINE_DCL void all_type_info_populate (PyTypeObject *t, std::vector<type_info *> &bases) {
89
+ PYBIND11_NOINLINE void all_type_info_populate (PyTypeObject *t, std::vector<type_info *> &bases) {
90
90
std::vector<PyTypeObject *> check;
91
91
for (handle parent : reinterpret_borrow<tuple>(t->tp_bases ))
92
92
check.push_back ((PyTypeObject *) parent.ptr ());
@@ -155,7 +155,7 @@ inline const std::vector<detail::type_info *> &all_type_info(PyTypeObject *type)
155
155
* ancestors are pybind11-registered. Throws an exception if there are multiple bases--use
156
156
* `all_type_info` instead if you want to support multiple bases.
157
157
*/
158
- PYBIND11_NOINLINE_DCL detail::type_info* get_type_info (PyTypeObject *type) {
158
+ PYBIND11_NOINLINE detail::type_info* get_type_info (PyTypeObject *type) {
159
159
auto &bases = all_type_info (type);
160
160
if (bases.empty ())
161
161
return nullptr ;
@@ -181,7 +181,7 @@ inline detail::type_info *get_global_type_info(const std::type_index &tp) {
181
181
}
182
182
183
183
// / Return the type info for a given C++ type; on lookup failure can either throw or return nullptr.
184
- PYBIND11_NOINLINE_DCL detail::type_info *get_type_info (const std::type_index &tp,
184
+ PYBIND11_NOINLINE detail::type_info *get_type_info (const std::type_index &tp,
185
185
bool throw_if_missing = false ) {
186
186
if (auto ltype = get_local_type_info (tp))
187
187
return ltype;
@@ -196,13 +196,13 @@ PYBIND11_NOINLINE_DCL detail::type_info *get_type_info(const std::type_index &tp
196
196
return nullptr ;
197
197
}
198
198
199
- PYBIND11_NOINLINE_DCL handle get_type_handle (const std::type_info &tp, bool throw_if_missing) {
199
+ PYBIND11_NOINLINE handle get_type_handle (const std::type_info &tp, bool throw_if_missing) {
200
200
detail::type_info *type_info = get_type_info (tp, throw_if_missing);
201
201
return handle (type_info ? ((PyObject *) type_info->type ) : nullptr );
202
202
}
203
203
204
204
// Searches the inheritance graph for a registered Python instance, using all_type_info().
205
- PYBIND11_NOINLINE_DCL handle find_registered_python_instance (void *src,
205
+ PYBIND11_NOINLINE handle find_registered_python_instance (void *src,
206
206
const detail::type_info *tinfo) {
207
207
auto it_instances = get_internals ().registered_instances .equal_range (src);
208
208
for (auto it_i = it_instances.first ; it_i != it_instances.second ; ++it_i) {
@@ -330,7 +330,7 @@ struct values_and_holders {
330
330
* The returned object should be short-lived: in particular, it must not outlive the called-upon
331
331
* instance.
332
332
*/
333
- PYBIND11_NOINLINE_DCL value_and_holder instance::get_value_and_holder (const type_info *find_type /* = nullptr default in common.h*/ , bool throw_if_missing /* = true in common.h*/ ) {
333
+ PYBIND11_NOINLINE value_and_holder instance::get_value_and_holder (const type_info *find_type /* = nullptr default in common.h*/ , bool throw_if_missing /* = true in common.h*/ ) {
334
334
// Optimize common case:
335
335
if (!find_type || Py_TYPE (this ) == find_type->type )
336
336
return value_and_holder (this , find_type, 0 , 0 );
@@ -354,7 +354,7 @@ PYBIND11_NOINLINE_DCL value_and_holder instance::get_value_and_holder(const type
354
354
#endif
355
355
}
356
356
357
- PYBIND11_NOINLINE_DCL void instance::allocate_layout () {
357
+ PYBIND11_NOINLINE void instance::allocate_layout () {
358
358
auto &tinfo = all_type_info (Py_TYPE (this ));
359
359
360
360
const size_t n_types = tinfo.size ();
@@ -402,19 +402,19 @@ PYBIND11_NOINLINE_DCL void instance::allocate_layout() {
402
402
owned = true ;
403
403
}
404
404
405
- PYBIND11_NOINLINE_DCL void instance::deallocate_layout () const {
405
+ PYBIND11_NOINLINE void instance::deallocate_layout () const {
406
406
if (!simple_layout)
407
407
PyMem_Free (nonsimple.values_and_holders );
408
408
}
409
409
410
- PYBIND11_NOINLINE_DCL bool isinstance_generic (handle obj, const std::type_info &tp) {
410
+ PYBIND11_NOINLINE bool isinstance_generic (handle obj, const std::type_info &tp) {
411
411
handle type = detail::get_type_handle (tp, false );
412
412
if (!type)
413
413
return false ;
414
414
return isinstance (obj, type);
415
415
}
416
416
417
- PYBIND11_NOINLINE_DCL std::string error_string () {
417
+ PYBIND11_NOINLINE std::string error_string () {
418
418
if (!PyErr_Occurred ()) {
419
419
PyErr_SetString (PyExc_RuntimeError, " Unknown internal error occurred" );
420
420
return " Unknown internal error occurred" ;
@@ -461,7 +461,7 @@ PYBIND11_NOINLINE_DCL std::string error_string() {
461
461
return errorString;
462
462
}
463
463
464
- PYBIND11_NOINLINE_DCL handle get_object_handle (const void *ptr, const detail::type_info *type ) {
464
+ PYBIND11_NOINLINE handle get_object_handle (const void *ptr, const detail::type_info *type ) {
465
465
auto &instances = get_internals ().registered_instances ;
466
466
auto range = instances.equal_range (ptr);
467
467
for (auto it = range.first ; it != range.second ; ++it) {
@@ -488,12 +488,12 @@ inline PyThreadState *get_thread_state_unchecked() {
488
488
}
489
489
490
490
// Forward declarations
491
- PYBIND11_NOINLINE_FWD void keep_alive_impl (handle nurse, handle patient);
491
+ void keep_alive_impl (handle nurse, handle patient);
492
492
inline PyObject *make_new_instance (PyTypeObject *type);
493
493
494
494
class type_caster_generic {
495
495
public:
496
- PYBIND11_NOINLINE_DCL type_caster_generic (const std::type_info &type_info)
496
+ PYBIND11_NOINLINE type_caster_generic (const std::type_info &type_info)
497
497
: typeinfo(get_type_info(type_info)), cpptype(&type_info) { }
498
498
499
499
type_caster_generic (const type_info *typeinfo)
@@ -503,7 +503,7 @@ class type_caster_generic {
503
503
return load_impl<type_caster_generic>(src, convert);
504
504
}
505
505
506
- PYBIND11_NOINLINE_DCL static handle cast (const void *_src, return_value_policy policy, handle parent,
506
+ PYBIND11_NOINLINE static handle cast (const void *_src, return_value_policy policy, handle parent,
507
507
const detail::type_info *tinfo,
508
508
void *(*copy_constructor)(const void *),
509
509
void *(*move_constructor)(const void *),
@@ -627,7 +627,7 @@ class type_caster_generic {
627
627
}
628
628
void check_holder_compat () {}
629
629
630
- PYBIND11_NOINLINE_DCL static void *local_load (PyObject *src, const type_info *ti) {
630
+ PYBIND11_NOINLINE static void *local_load (PyObject *src, const type_info *ti) {
631
631
auto caster = type_caster_generic (ti);
632
632
if (caster.load (src, false ))
633
633
return caster.value ;
@@ -636,7 +636,7 @@ class type_caster_generic {
636
636
637
637
// / Try to load with foreign typeinfo, if available. Used when there is no
638
638
// / native typeinfo, or when the native one wasn't able to produce a value.
639
- PYBIND11_NOINLINE_DCL bool try_load_foreign_module_local (handle src) {
639
+ PYBIND11_NOINLINE bool try_load_foreign_module_local (handle src) {
640
640
constexpr auto *local_key = PYBIND11_MODULE_LOCAL_ID;
641
641
const auto pytype = type::handle_of (src);
642
642
if (!hasattr (pytype, local_key))
@@ -659,7 +659,7 @@ class type_caster_generic {
659
659
// bits of code between here and copyable_holder_caster where the two classes need different
660
660
// logic (without having to resort to virtual inheritance).
661
661
template <typename ThisT>
662
- PYBIND11_NOINLINE_DCL bool load_impl (handle src, bool convert) {
662
+ PYBIND11_NOINLINE bool load_impl (handle src, bool convert) {
663
663
if (!src) return false ;
664
664
if (!typeinfo) return try_load_foreign_module_local (src);
665
665
@@ -749,7 +749,7 @@ class type_caster_generic {
749
749
// Called to do type lookup and wrap the pointer and type in a pair when a dynamic_cast
750
750
// isn't needed or can't be used. If the type is unknown, sets the error and returns a pair
751
751
// with .second = nullptr. (p.first = nullptr is not an error: it becomes None).
752
- PYBIND11_NOINLINE_DCL static std::pair<const void *, const type_info *> src_and_type (
752
+ PYBIND11_NOINLINE static std::pair<const void *, const type_info *> src_and_type (
753
753
const void *src, const std::type_info &cast_type, const std::type_info *rtti_type = nullptr ) {
754
754
if (auto *tpi = get_type_info (cast_type))
755
755
return {src, const_cast <const type_info *>(tpi)};
0 commit comments