1 /* Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 * Use of this source code is governed by a BSD-style license that can be
3 * found in the LICENSE file.
6 /* From pp_bool.idl modified Thu Nov 1 13:48:33 2012. */
8 #ifndef PPAPI_C_PP_BOOL_H_
9 #define PPAPI_C_PP_BOOL_H_
11 #include "ppapi/c/pp_macros.h"
15 * This file defines the <code>PP_Bool</code> enumeration for use in PPAPI C
25 * The <code>PP_Bool</code> enum is a boolean value for use in PPAPI C headers.
26 * The standard bool type is not available to pre-C99 compilers, and is not
27 * guaranteed to be compatible between C and C++, whereas the PPAPI C headers
28 * can be included from C or C++ code.
34 PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_Bool
, 4);
41 * Converts a C++ "bool" type to a PP_Bool.
43 * @param[in] b A C++ "bool" type.
47 inline PP_Bool
PP_FromBool(bool b
) {
48 return b
? PP_TRUE
: PP_FALSE
;
52 * Converts a PP_Bool to a C++ "bool" type.
54 * @param[in] b A PP_Bool.
56 * @return A C++ "bool" type.
58 inline bool PP_ToBool(PP_Bool b
) {
59 return (b
!= PP_FALSE
);
62 #endif /* __cplusplus */
64 #endif /* PPAPI_C_PP_BOOL_H_ */