summaryrefslogtreecommitdiff
path: root/docs/examples/tutorial/embedding/embedded.pyx
Commit message (Collapse)AuthorAgeFilesLines
* Fix linkage for `cdef public` functions in C++ mode (#5040)Maximilien Colange2022-11-081-0/+1
| | | | | | | | | | | | Fixes #1839 cdef public functions should be declared with the appropriate linkage: * in C mode, either extern or extern "C", depending on whether the header file is included in (resp. object code is linked against) a C or a C++ compilation unit. Choice is made at compile-time through #ifdef __cplusplus macros. NB: This is the current behavior. * in C++ mode, extern "C++" is the only option, as C code cannot call C++ code. Note that extern "C++" should be preferred over extern to allow users to #include the C++ header inside a extern "C" block (which is legal, although barely used). Note that the current behavior is OK for C mode, but is incorrect for the C++ mode. As described in #1839, this incorrect behavior is diagnosed by compilers emitting warnings when cdef public functions return a C++ type (e.g. std::vector). The test introduced in this PR checks that the current behavior for C mode (with both C and C++ compatibility) is preserved, and that the behavior for C++ mode is fixed.
* [docs] Fix typo in embedded.pyxda-woods2022-07-271-1/+1
|
* Rename embedding tests in docs to make it easier to find and select in the ↵Stefan Behnel2020-05-051-0/+11
test suite.