OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2010 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. |
| 4 |
| 5 #ifndef PPAPI_C_PP_MACROS_H_ |
| 6 #define PPAPI_C_PP_MACROS_H_ |
| 7 |
| 8 /** |
| 9 * @file |
| 10 * Defines the API ... |
| 11 * |
| 12 * @addtogroup PP |
| 13 * @{ |
| 14 */ |
| 15 |
| 16 /* Use PP_INLINE to tell the compiler to inline functions. The main purpose of |
| 17 * inline functions in ppapi is to allow us to define convenience functions in |
| 18 * the ppapi header files, without requiring clients or implementers to link a |
| 19 * PPAPI C library. The "inline" keyword is not supported by pre-C99 C |
| 20 * compilers (such as MS Visual Studio 2008 and older versions of GCC). MSVS |
| 21 * supports __forceinline and GCC supports __inline__. Use of the static |
| 22 * keyword ensures (in C) that the function is not compiled on its own, which |
| 23 * could cause multiple definition errors. |
| 24 * http://msdn.microsoft.com/en-us/library/z8y1yy88.aspx |
| 25 * http://gcc.gnu.org/onlinedocs/gcc/Inline.html |
| 26 */ |
| 27 #if defined(__cplusplus) |
| 28 /* The inline keyword is part of C++ and guarantees we won't get multiple |
| 29 * definition errors. |
| 30 */ |
| 31 # define PP_INLINE inline |
| 32 #else |
| 33 # if defined(_MSC_VER) |
| 34 # define PP_INLINE static __forceinline |
| 35 # else |
| 36 # define PP_INLINE static __inline__ |
| 37 # endif |
| 38 #endif |
| 39 |
| 40 /** |
| 41 * @} |
| 42 * End of addtogroup PP |
| 43 */ |
| 44 |
| 45 #endif // PPAPI_C_PP_MACROS_H_ |
| 46 |
OLD | NEW |