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 /** | 6 /** |
7 * Defines the API ... | 7 * Defines the API ... |
8 */ | 8 */ |
9 | 9 |
10 #inline c | 10 #inline c |
11 | 11 |
12 /* | 12 /* |
13 * @addtogroup PP | 13 * @addtogroup PP |
14 * @{ | 14 * @{ |
15 */ | 15 */ |
16 | 16 |
17 /* These precompiler names were copied from chromium's build_config.h. */ | |
18 | |
19 /* | |
20 * A set of macros to use for platform detection. These were largely copied | |
21 * from chromium's build_config.h. | |
22 */ | |
23 #if defined(__APPLE__) | |
brettw
2011/12/01 18:29:22
It doesn't seem like all this code should be at th
dmichael (off chromium)
2011/12/01 18:40:53
Good point. Done.
| |
24 #define PPAPI_OS_MACOSX 1 | |
25 #elif defined(ANDROID) | |
26 #define PPAPI_OS_ANDROID 1 | |
27 #elif defined(__native_client__) | |
28 #define PPAPI_OS_NACL 1 | |
29 #elif defined(__linux__) | |
30 #define PPAPI_OS_LINUX 1 | |
31 #elif defined(_WIN32) | |
32 #define PPAPI_OS_WIN 1 | |
33 #elif defined(__FreeBSD__) | |
34 #define PPAPI_OS_FREEBSD 1 | |
35 #elif defined(__OpenBSD__) | |
36 #define PPAPI_OS_OPENBSD 1 | |
37 #elif defined(__sun) | |
38 #define PPAPI_OS_SOLARIS 1 | |
39 #else | |
40 #error Please add support for your platform in ppapi/c/pp_macros.h. | |
41 #endif | |
42 | |
43 /* These are used to determine POSIX-like implementations vs Windows. */ | |
44 #if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || \ | |
45 defined(__OpenBSD__) || defined(__sun) || defined(__native_client__) | |
46 #define PPAPI_POSIX 1 | |
47 #endif | |
48 | |
17 /* Use PP_INLINE to tell the compiler to inline functions. The main purpose of | 49 /* Use PP_INLINE to tell the compiler to inline functions. The main purpose of |
18 * inline functions in ppapi is to allow us to define convenience functions in | 50 * inline functions in ppapi is to allow us to define convenience functions in |
19 * the ppapi header files, without requiring clients or implementers to link a | 51 * the ppapi header files, without requiring clients or implementers to link a |
20 * PPAPI C library. The "inline" keyword is not supported by pre-C99 C | 52 * PPAPI C library. The "inline" keyword is not supported by pre-C99 C |
21 * compilers (such as MS Visual Studio 2008 and older versions of GCC). MSVS | 53 * compilers (such as MS Visual Studio 2008 and older versions of GCC). MSVS |
22 * supports __forceinline and GCC supports __inline__. Use of the static | 54 * supports __forceinline and GCC supports __inline__. Use of the static |
23 * keyword ensures (in C) that the function is not compiled on its own, which | 55 * keyword ensures (in C) that the function is not compiled on its own, which |
24 * could cause multiple definition errors. | 56 * could cause multiple definition errors. |
25 * http://msdn.microsoft.com/en-us/library/z8y1yy88.aspx | 57 * http://msdn.microsoft.com/en-us/library/z8y1yy88.aspx |
26 * http://gcc.gnu.org/onlinedocs/gcc/Inline.html | 58 * http://gcc.gnu.org/onlinedocs/gcc/Inline.html |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
86 #define PP_COMPILE_ASSERT_ENUM_SIZE_IN_BYTES(NAME, SIZE) \ | 118 #define PP_COMPILE_ASSERT_ENUM_SIZE_IN_BYTES(NAME, SIZE) \ |
87 PP_COMPILE_ASSERT_SIZE_IN_BYTES_IMPL(NAME, enum NAME, SIZE) | 119 PP_COMPILE_ASSERT_SIZE_IN_BYTES_IMPL(NAME, enum NAME, SIZE) |
88 | 120 |
89 /** | 121 /** |
90 * @} | 122 * @} |
91 * End of addtogroup PP | 123 * End of addtogroup PP |
92 */ | 124 */ |
93 | 125 |
94 #endinl | 126 #endinl |
95 | 127 |
OLD | NEW |