summaryrefslogtreecommitdiffstats
path: root/ppapi/c/pp_bool.h
diff options
context:
space:
mode:
Diffstat (limited to 'ppapi/c/pp_bool.h')
-rw-r--r--ppapi/c/pp_bool.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/ppapi/c/pp_bool.h b/ppapi/c/pp_bool.h
index d53fa00..55ca4b0 100644
--- a/ppapi/c/pp_bool.h
+++ b/ppapi/c/pp_bool.h
@@ -33,5 +33,21 @@ PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_Bool, 4);
* @}
*/
+#ifdef __cplusplus
+/**
+ * Converts a C++ "bool" type to a PP_Bool.
+ */
+inline PP_Bool PP_FromBool(bool b) {
+ return b ? PP_TRUE : PP_FALSE;
+}
+
+/**
+ * Converts a PP_Bool to a C++ "bool" type.
+ */
+inline bool PP_ToBool(PP_Bool b) {
+ return (b != PP_FALSE);
+}
+#endif // __cplusplus
+
#endif /* PPAPI_C_PP_BOOL_H_ */