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
978d439e
Commit
978d439e
authored
Nov 03, 2018
by
Michał Wawrzyniec Urbańczyk
Committed by
Wenzel Jakob
Nov 03, 2018
Browse files
Add PYBIND11_ prefix to the THROW macro to prevent name collisions. (#1578)
parent
741576dd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
include/pybind11/pybind11.h
include/pybind11/pybind11.h
+6
-6
No files found.
include/pybind11/pybind11.h
View file @
978d439e
...
...
@@ -1464,12 +1464,12 @@ struct enum_base {
PYBIND11_ENUM_OP_STRICT
(
"__ne__"
,
!
int_
(
a
).
equal
(
int_
(
b
)),
return
true
);
if
(
is_arithmetic
)
{
#define THROW throw type_error("Expected an enumeration of matching type!");
PYBIND11_ENUM_OP_STRICT
(
"__lt__"
,
int_
(
a
)
<
int_
(
b
),
THROW
);
PYBIND11_ENUM_OP_STRICT
(
"__gt__"
,
int_
(
a
)
>
int_
(
b
),
THROW
);
PYBIND11_ENUM_OP_STRICT
(
"__le__"
,
int_
(
a
)
<=
int_
(
b
),
THROW
);
PYBIND11_ENUM_OP_STRICT
(
"__ge__"
,
int_
(
a
)
>=
int_
(
b
),
THROW
);
#undef THROW
#define
PYBIND11_
THROW throw type_error("Expected an enumeration of matching type!");
PYBIND11_ENUM_OP_STRICT
(
"__lt__"
,
int_
(
a
)
<
int_
(
b
),
PYBIND11_
THROW
);
PYBIND11_ENUM_OP_STRICT
(
"__gt__"
,
int_
(
a
)
>
int_
(
b
),
PYBIND11_
THROW
);
PYBIND11_ENUM_OP_STRICT
(
"__le__"
,
int_
(
a
)
<=
int_
(
b
),
PYBIND11_
THROW
);
PYBIND11_ENUM_OP_STRICT
(
"__ge__"
,
int_
(
a
)
>=
int_
(
b
),
PYBIND11_
THROW
);
#undef
PYBIND11_
THROW
}
}
...
...
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