Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
pybind11
Commits
95545e62
Commit
95545e62
authored
Jun 27, 2016
by
Ivan Smirnov
Browse files
Change PB11_IMPL prefix to PYBIND11, add comment
parent
7bdd74a9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
27 deletions
+28
-27
include/pybind11/numpy.h
include/pybind11/numpy.h
+28
-27
No files found.
include/pybind11/numpy.h
View file @
95545e62
...
@@ -271,7 +271,7 @@ private:
...
@@ -271,7 +271,7 @@ private:
static
inline
char
*
format_
()
{
static
char
s
[
4096
];
return
s
;
}
static
inline
char
*
format_
()
{
static
char
s
[
4096
];
return
s
;
}
};
};
#define P
B11_IMPL
_FIELD_DESCRIPTOR(Type, Field) \
#define P
YBIND11
_FIELD_DESCRIPTOR(Type, Field) \
::pybind11::detail::field_descriptor { \
::pybind11::detail::field_descriptor { \
#Field, offsetof(Type, Field), \
#Field, offsetof(Type, Field), \
::pybind11::detail::npy_format_descriptor<decltype(static_cast<Type*>(0)->Field)>::dtype() \
::pybind11::detail::npy_format_descriptor<decltype(static_cast<Type*>(0)->Field)>::dtype() \
...
@@ -279,37 +279,38 @@ private:
...
@@ -279,37 +279,38 @@ private:
// The main idea of this macro is borrowed from https://github.com/swansontec/map-macro
// The main idea of this macro is borrowed from https://github.com/swansontec/map-macro
// (C) William Swanson, Paul Fultz
// (C) William Swanson, Paul Fultz
#define P
B11_IMPL
_EVAL0(...) __VA_ARGS__
#define P
YBIND11
_EVAL0(...) __VA_ARGS__
#define P
B11_IMPL
_EVAL1(...) P
B11_IMPL
_EVAL0 (P
B11_IMPL
_EVAL0 (P
B11_IMPL
_EVAL0 (__VA_ARGS__)))
#define P
YBIND11
_EVAL1(...) P
YBIND11
_EVAL0 (P
YBIND11
_EVAL0 (P
YBIND11
_EVAL0 (__VA_ARGS__)))
#define P
B11_IMPL
_EVAL2(...) P
B11_IMPL
_EVAL1 (P
B11_IMPL
_EVAL1 (P
B11_IMPL
_EVAL1 (__VA_ARGS__)))
#define P
YBIND11
_EVAL2(...) P
YBIND11
_EVAL1 (P
YBIND11
_EVAL1 (P
YBIND11
_EVAL1 (__VA_ARGS__)))
#define P
B11_IMPL
_EVAL3(...) P
B11_IMPL
_EVAL2 (P
B11_IMPL
_EVAL2 (P
B11_IMPL
_EVAL2 (__VA_ARGS__)))
#define P
YBIND11
_EVAL3(...) P
YBIND11
_EVAL2 (P
YBIND11
_EVAL2 (P
YBIND11
_EVAL2 (__VA_ARGS__)))
#define P
B11_IMPL
_EVAL4(...) P
B11_IMPL
_EVAL3 (P
B11_IMPL
_EVAL3 (P
B11_IMPL
_EVAL3 (__VA_ARGS__)))
#define P
YBIND11
_EVAL4(...) P
YBIND11
_EVAL3 (P
YBIND11
_EVAL3 (P
YBIND11
_EVAL3 (__VA_ARGS__)))
#define P
B11_IMPL
_EVAL(...) P
B11_IMPL
_EVAL4 (P
B11_IMPL
_EVAL4 (P
B11_IMPL
_EVAL4 (__VA_ARGS__)))
#define P
YBIND11
_EVAL(...) P
YBIND11
_EVAL4 (P
YBIND11
_EVAL4 (P
YBIND11
_EVAL4 (__VA_ARGS__)))
#define P
B11_IMPL
_MAP_END(...)
#define P
YBIND11
_MAP_END(...)
#define P
B11_IMPL
_MAP_OUT
#define P
YBIND11
_MAP_OUT
#define P
B11_IMPL
_MAP_COMMA ,
#define P
YBIND11
_MAP_COMMA ,
#define P
B11_IMPL
_MAP_GET_END() 0, P
B11_IMPL
_MAP_END
#define P
YBIND11
_MAP_GET_END() 0, P
YBIND11
_MAP_END
#define P
B11_IMPL
_MAP_NEXT0(test, next, ...) next P
B11_IMPL
_MAP_OUT
#define P
YBIND11
_MAP_NEXT0(test, next, ...) next P
YBIND11
_MAP_OUT
#define P
B11_IMPL
_MAP_NEXT1(test, next) P
B11_IMPL
_MAP_NEXT0 (test, next, 0)
#define P
YBIND11
_MAP_NEXT1(test, next) P
YBIND11
_MAP_NEXT0 (test, next, 0)
#define P
B11_IMPL
_MAP_NEXT(test, next) P
B11_IMPL
_MAP_NEXT1 (P
B11_IMPL
_MAP_GET_END test, next)
#define P
YBIND11
_MAP_NEXT(test, next) P
YBIND11
_MAP_NEXT1 (P
YBIND11
_MAP_GET_END test, next)
#ifdef _MSC_VER
#ifdef _MSC_VER
// MSVC is not as eager to expand macros
#define P
B11_IMPL
_MAP_LIST_NEXT1(test, next) \
#define P
YBIND11
_MAP_LIST_NEXT1(test, next) \
P
B11_IMPL_EVAL0 (PB11_IMPL
_MAP_NEXT0 (test, P
B11_IMPL
_MAP_COMMA next, 0))
P
YBIND11_EVAL0 (PYBIND11
_MAP_NEXT0 (test, P
YBIND11
_MAP_COMMA next, 0))
#else
#else
#define P
B11_IMPL
_MAP_LIST_NEXT1(test, next) \
#define P
YBIND11
_MAP_LIST_NEXT1(test, next) \
P
B11_IMPL
_MAP_NEXT0 (test, P
B11_IMPL
_MAP_COMMA next, 0)
P
YBIND11
_MAP_NEXT0 (test, P
YBIND11
_MAP_COMMA next, 0)
#endif
#endif
#define PB11_IMPL_MAP_LIST_NEXT(test, next) \
#define PYBIND11_MAP_LIST_NEXT(test, next) \
PB11_IMPL_MAP_LIST_NEXT1 (PB11_IMPL_MAP_GET_END test, next)
PYBIND11_MAP_LIST_NEXT1 (PYBIND11_MAP_GET_END test, next)
#define PB11_IMPL_MAP_LIST0(f, t, x, peek, ...) \
#define PYBIND11_MAP_LIST0(f, t, x, peek, ...) \
f(t, x) PB11_IMPL_MAP_LIST_NEXT (peek, PB11_IMPL_MAP_LIST1) (f, t, peek, __VA_ARGS__)
f(t, x) PYBIND11_MAP_LIST_NEXT (peek, PYBIND11_MAP_LIST1) (f, t, peek, __VA_ARGS__)
#define PB11_IMPL_MAP_LIST1(f, t, x, peek, ...) \
#define PYBIND11_MAP_LIST1(f, t, x, peek, ...) \
f(t, x) PB11_IMPL_MAP_LIST_NEXT (peek, PB11_IMPL_MAP_LIST0) (f, t, peek, __VA_ARGS__)
f(t, x) PYBIND11_MAP_LIST_NEXT (peek, PYBIND11_MAP_LIST0) (f, t, peek, __VA_ARGS__)
#define PB11_IMPL_MAP_LIST(f, t, ...) PB11_IMPL_EVAL (PB11_IMPL_MAP_LIST1 (f, t, __VA_ARGS__, (), 0))
#define PYBIND11_MAP_LIST(f, t, ...) \
PYBIND11_EVAL (PYBIND11_MAP_LIST1 (f, t, __VA_ARGS__, (), 0))
#define PYBIND11_DTYPE(Type, ...) \
#define PYBIND11_DTYPE(Type, ...) \
::pybind11::detail::npy_format_descriptor<Type>::register_dtype \
::pybind11::detail::npy_format_descriptor<Type>::register_dtype \
({P
B11_IMPL
_MAP_LIST(P
B11_IMPL
_FIELD_DESCRIPTOR, Type, __VA_ARGS__)})
({P
YBIND11
_MAP_LIST
(P
YBIND11
_FIELD_DESCRIPTOR, Type, __VA_ARGS__)})
template
<
class
T
>
template
<
class
T
>
using
array_iterator
=
typename
std
::
add_pointer
<
T
>::
type
;
using
array_iterator
=
typename
std
::
add_pointer
<
T
>::
type
;
...
...
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