Skip to content

Commit

Permalink
Disable __VA_OPT__(, ) __VA_ARGS__ usage for MSVC (it is unclear to…
Browse files Browse the repository at this point in the history
… rwgk why it does not work).

This is the beginning of the error message:

```
         D:\a\pybind11\pybind11\tests\test_smart_ptr.cpp(285,1): error C2143: syntax error: missing ')' before ',' [D:\a\pybind11\pybind11\build\tests\pybind11_tests.vcxproj]
         D:\a\pybind11\pybind11\tests\test_smart_ptr.cpp(285,1): error C2059: syntax error: ')' [D:\a\pybind11\pybind11\build\tests\pybind11_tests.vcxproj]
```
  • Loading branch information
rwgk committed Nov 30, 2024
1 parent 98b035a commit 5c5dc8b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/pybind11/cast.h
Original file line number Diff line number Diff line change
Expand Up @@ -881,7 +881,7 @@ struct always_construct_holder {
: public type_caster_holder<type, __VA_ARGS__> {}; \
} \
PYBIND11_NAMESPACE_END(PYBIND11_NAMESPACE)
#if defined(PYBIND11_CPP20)
#if defined(PYBIND11_CPP20) && !defined(_MSC_VER)
# define PYBIND11_DECLARE_HOLDER_TYPE(type, holder_type, ...) \
PYBIND11_DECLARE_HOLDER_TYPE_PART1(type, holder_type) \
void __VA_OPT__(, ) __VA_ARGS__ PYBIND11_DECLARE_HOLDER_TYPE_PART2(type, holder_type)
Expand Down

0 comments on commit 5c5dc8b

Please sign in to comment.