Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
pybind11
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open
pybind11
Commits
77586fd6
Commit
77586fd6
authored
Mar 06, 2016
by
Wenzel Jakob
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add version suffix to internal pybind11 data structures to avoid conflicts with future versions
parent
8d862b37
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
2 deletions
+7
-2
include/pybind11/cast.h
+3
-2
include/pybind11/common.h
+4
-0
No files found.
include/pybind11/cast.h
View file @
77586fd6
...
...
@@ -34,12 +34,13 @@ PYBIND11_NOINLINE inline internals &get_internals() {
if
(
internals_ptr
)
return
*
internals_ptr
;
handle
builtins
(
PyEval_GetBuiltins
());
capsule
caps
(
builtins
[
"__pybind11__"
]);
const
char
*
id
=
PYBIND11_INTERNALS_ID
;
capsule
caps
(
builtins
[
id
]);
if
(
caps
.
check
())
{
internals_ptr
=
caps
;
}
else
{
internals_ptr
=
new
internals
();
builtins
[
"__pybind11__"
]
=
capsule
(
internals_ptr
);
builtins
[
id
]
=
capsule
(
internals_ptr
);
}
return
*
internals_ptr
;
}
...
...
include/pybind11/common.h
View file @
77586fd6
...
...
@@ -110,6 +110,10 @@
#endif
#define PYBIND11_TRY_NEXT_OVERLOAD ((PyObject *) 1) // special failure return code
#define PYBIND11_STRINGIFY(x) #x
#define PYBIND11_TOSTRING(x) PYBIND11_STRINGIFY(x)
#define PYBIND11_INTERNALS_ID "__pybind11_" \
PYBIND11_TOSTRING(PYBIND11_VERSION_MAJOR) "_" PYBIND11_TOSTRING(PYBIND11_VERSION_MINOR) "__"
#define PYBIND11_PLUGIN(name) \
static PyObject *pybind11_init(); \
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment