1 /**************************************************************************
3 * Copyright 2007-2013 VMware, Inc.
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the
8 * "Software"), to deal in the Software without restriction, including
9 * without limitation the rights to use, copy, modify, merge, publish,
10 * distribute, sub license, and/or sell copies of the Software, and to
11 * permit persons to whom the Software is furnished to do so, subject to
12 * the following conditions:
14 * The above copyright notice and this permission notice (including the
15 * next paragraph) shall be included in all copies or substantial portions
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
21 * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR
22 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
23 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
24 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26 **************************************************************************/
28 #ifndef _C99_COMPAT_H_
29 #define _C99_COMPAT_H_
37 /* C++ supports inline keyword */
38 # elif defined(__GNUC__)
39 # define inline __inline__
40 # elif defined(_MSC_VER)
41 # define inline __inline
43 # define inline __inline
44 # elif defined(__INTEL_COMPILER)
45 /* Intel compiler supports inline keyword */
46 # elif defined(__WATCOMC__) && (__WATCOMC__ >= 1100)
47 # define inline __inline
48 # elif defined(__SUNPRO_C) && defined(__C99FEATURES__)
49 /* C99 supports inline keyword */
50 # elif (__STDC_VERSION__ >= 199901L)
51 /* C99 supports inline keyword */
59 * C99 restrict keyword
62 * - http://cellperformance.beyond3d.com/articles/2006/05/demystifying-the-restrict-keyword.html
65 # if (__STDC_VERSION__ >= 199901L)
67 # elif defined(__SUNPRO_C) && defined(__C99FEATURES__)
69 # elif defined(__GNUC__)
70 # define restrict __restrict__
71 # elif defined(_MSC_VER)
72 # define restrict __restrict
74 # define restrict /* */
83 # if (__STDC_VERSION__ >= 199901L)
85 # elif defined(__SUNPRO_C) && defined(__C99FEATURES__)
87 # elif defined(__GNUC__)
89 # define __func__ __FUNCTION__
91 # define __func__ "<unknown>"
93 # elif defined(_MSC_VER)
95 # define __func__ __FUNCTION__
97 # define __func__ "<unknown>"
100 # define __func__ "<unknown>"
105 #endif /* _C99_COMPAT_H_ */