Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(87)

Side by Side Diff: ppapi/c/pp_macros.h

Issue 4310002: Make PPAPI headers compile with C compilers (gcc on Linux & Mac and MSVS on W... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ppapi/c/pp_input_event.h ('k') | ppapi/c/pp_point.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(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
OLDNEW
« no previous file with comments | « ppapi/c/pp_input_event.h ('k') | ppapi/c/pp_point.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698