| OLD | NEW |
| 1 /* Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 /* Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 * Use of this source code is governed by a BSD-style license that can be | 2 * Use of this source code is governed by a BSD-style license that can be |
| 3 * found in the LICENSE file. | 3 * found in the LICENSE file. |
| 4 */ | 4 */ |
| 5 |
| 6 /* From pp_bool.idl modified Sat Jul 16 16:50:26 2011. */ |
| 7 |
| 5 #ifndef PPAPI_C_PP_BOOL_H_ | 8 #ifndef PPAPI_C_PP_BOOL_H_ |
| 6 #define PPAPI_C_PP_BOOL_H_ | 9 #define PPAPI_C_PP_BOOL_H_ |
| 7 | 10 |
| 8 #include "ppapi/c/pp_macros.h" | 11 #include "ppapi/c/pp_macros.h" |
| 9 | 12 |
| 10 /** | 13 /** |
| 11 * @file | 14 * @file |
| 12 * This file defines the <code>PP_Bool</code> enumeration for use in PPAPI C | 15 * This file defines the <code>PP_Bool</code> enumeration for use in PPAPI C |
| 13 * headers. | 16 * headers. |
| 14 */ | 17 */ |
| 15 | 18 |
| 19 |
| 16 /** | 20 /** |
| 17 * | |
| 18 * @addtogroup Enums | 21 * @addtogroup Enums |
| 19 * @{ | 22 * @{ |
| 20 */ | 23 */ |
| 21 | |
| 22 /** | 24 /** |
| 23 * The <code>PP_Bool</code> enum is a boolean value for use in PPAPI C headers. | 25 * The <code>PP_Bool</code> enum is a boolean value for use in PPAPI C headers. |
| 24 * The standard bool type is not available to pre-C99 compilers, and is not | 26 * The standard bool type is not available to pre-C99 compilers, and is not |
| 25 * guaranteed to be compatible between C and C++, whereas the PPAPI C headers | 27 * guaranteed to be compatible between C and C++, whereas the PPAPI C headers |
| 26 * can be included from C or C++ code. | 28 * can be included from C or C++ code. |
| 27 */ | 29 */ |
| 28 typedef enum { | 30 typedef enum { |
| 29 PP_FALSE = 0, | 31 PP_FALSE = 0, |
| 30 PP_TRUE = 1 | 32 PP_TRUE = 1 |
| 31 } PP_Bool; | 33 } PP_Bool; |
| 32 PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_Bool, 4); | 34 PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_Bool, 4); |
| 33 /** | 35 /** |
| 34 * @} | 36 * @} |
| 35 */ | 37 */ |
| 36 | 38 |
| 37 #ifdef __cplusplus | 39 #ifdef __cplusplus |
| 38 /** | 40 /** |
| 39 * Converts a C++ "bool" type to a PP_Bool. | 41 * Converts a C++ "bool" type to a PP_Bool. |
| 40 */ | 42 */ |
| 41 inline PP_Bool PP_FromBool(bool b) { | 43 inline PP_Bool PP_FromBool(bool b) { |
| 42 return b ? PP_TRUE : PP_FALSE; | 44 return b ? PP_TRUE : PP_FALSE; |
| 43 } | 45 } |
| 44 | 46 |
| 45 /** | 47 /** |
| 46 * Converts a PP_Bool to a C++ "bool" type. | 48 * Converts a PP_Bool to a C++ "bool" type. |
| 47 */ | 49 */ |
| 48 inline bool PP_ToBool(PP_Bool b) { | 50 inline bool PP_ToBool(PP_Bool b) { |
| 49 return (b != PP_FALSE); | 51 return (b != PP_FALSE); |
| 50 } | 52 } |
| 53 |
| 51 #endif // __cplusplus | 54 #endif // __cplusplus |
| 52 | 55 |
| 53 #endif /* PPAPI_C_PP_BOOL_H_ */ | 56 #endif /* PPAPI_C_PP_BOOL_H_ */ |
| 54 | 57 |
| OLD | NEW |