summaryrefslogtreecommitdiffstats
path: root/ppapi
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-26 21:14:19 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-26 21:14:19 +0000
commitf0318a45807f5d3943804475663c09f55dcc3607 (patch)
tree2c975142e629d1fe608da9004d18c3ed83502925 /ppapi
parentd3389e674181ec597b953324a2e638c5173d8710 (diff)
downloadchromium_src-f0318a45807f5d3943804475663c09f55dcc3607.zip
chromium_src-f0318a45807f5d3943804475663c09f55dcc3607.tar.gz
chromium_src-f0318a45807f5d3943804475663c09f55dcc3607.tar.bz2
Add PP_Bool conversion functions to pp_bool.h as disussed on the mailing list.
TEST=none BUG=none Review URL: http://codereview.chromium.org/6962019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@86898 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi')
-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_ */