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 | 5 |
6 /* From pp_macros.idl modified Sat Jul 16 16:50:26 2011. */ | 6 /* From pp_macros.idl modified Wed Nov 30 23:01:17 2011. */ |
7 | 7 |
8 #ifndef PPAPI_C_PP_MACROS_H_ | 8 #ifndef PPAPI_C_PP_MACROS_H_ |
9 #define PPAPI_C_PP_MACROS_H_ | 9 #define PPAPI_C_PP_MACROS_H_ |
10 | 10 |
11 | 11 |
12 /** | 12 /** |
13 * @file | 13 * @file |
14 * Defines the API ... | 14 * Defines the API ... |
15 */ | 15 */ |
16 | 16 |
17 | 17 |
18 | 18 |
19 /* | 19 /* |
20 * @addtogroup PP | 20 * @addtogroup PP |
21 * @{ | 21 * @{ |
22 */ | 22 */ |
23 | 23 |
| 24 /* These precompiler names were copied from chromium's build_config.h. */ |
| 25 |
| 26 /* |
| 27 * A set of macros to use for platform detection. These were largely copied |
| 28 * from chromium's build_config.h. |
| 29 */ |
| 30 #if defined(__APPLE__) |
| 31 #define PPAPI_OS_MACOSX 1 |
| 32 #elif defined(ANDROID) |
| 33 #define PPAPI_OS_ANDROID 1 |
| 34 #elif defined(__native_client__) |
| 35 #define PPAPI_OS_NACL 1 |
| 36 #elif defined(__linux__) |
| 37 #define PPAPI_OS_LINUX 1 |
| 38 #elif defined(_WIN32) |
| 39 #define PPAPI_OS_WIN 1 |
| 40 #elif defined(__FreeBSD__) |
| 41 #define PPAPI_OS_FREEBSD 1 |
| 42 #elif defined(__OpenBSD__) |
| 43 #define PPAPI_OS_OPENBSD 1 |
| 44 #elif defined(__sun) |
| 45 #define PPAPI_OS_SOLARIS 1 |
| 46 #else |
| 47 #error Please add support for your platform in ppapi/c/pp_macros.h. |
| 48 #endif |
| 49 |
| 50 /* These are used to determine POSIX-like implementations vs Windows. */ |
| 51 #if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || \ |
| 52 defined(__OpenBSD__) || defined(__sun) || defined(__native_client__) |
| 53 #define PPAPI_POSIX 1 |
| 54 #endif |
| 55 |
24 /* Use PP_INLINE to tell the compiler to inline functions. The main purpose of | 56 /* Use PP_INLINE to tell the compiler to inline functions. The main purpose of |
25 * inline functions in ppapi is to allow us to define convenience functions in | 57 * inline functions in ppapi is to allow us to define convenience functions in |
26 * the ppapi header files, without requiring clients or implementers to link a | 58 * the ppapi header files, without requiring clients or implementers to link a |
27 * PPAPI C library. The "inline" keyword is not supported by pre-C99 C | 59 * PPAPI C library. The "inline" keyword is not supported by pre-C99 C |
28 * compilers (such as MS Visual Studio 2008 and older versions of GCC). MSVS | 60 * compilers (such as MS Visual Studio 2008 and older versions of GCC). MSVS |
29 * supports __forceinline and GCC supports __inline__. Use of the static | 61 * supports __forceinline and GCC supports __inline__. Use of the static |
30 * keyword ensures (in C) that the function is not compiled on its own, which | 62 * keyword ensures (in C) that the function is not compiled on its own, which |
31 * could cause multiple definition errors. | 63 * could cause multiple definition errors. |
32 * http://msdn.microsoft.com/en-us/library/z8y1yy88.aspx | 64 * http://msdn.microsoft.com/en-us/library/z8y1yy88.aspx |
33 * http://gcc.gnu.org/onlinedocs/gcc/Inline.html | 65 * http://gcc.gnu.org/onlinedocs/gcc/Inline.html |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 #define PP_COMPILE_ASSERT_ENUM_SIZE_IN_BYTES(NAME, SIZE) \ | 125 #define PP_COMPILE_ASSERT_ENUM_SIZE_IN_BYTES(NAME, SIZE) \ |
94 PP_COMPILE_ASSERT_SIZE_IN_BYTES_IMPL(NAME, enum NAME, SIZE) | 126 PP_COMPILE_ASSERT_SIZE_IN_BYTES_IMPL(NAME, enum NAME, SIZE) |
95 | 127 |
96 /** | 128 /** |
97 * @} | 129 * @} |
98 * End of addtogroup PP | 130 * End of addtogroup PP |
99 */ | 131 */ |
100 | 132 |
101 #endif /* PPAPI_C_PP_MACROS_H_ */ | 133 #endif /* PPAPI_C_PP_MACROS_H_ */ |
102 | 134 |
OLD | NEW |