OSVR-Core
AnnotationMacrosC.h
Go to the documentation of this file.
1 
16 /*
17 // Copyright 2014 Sensics, Inc.
18 //
19 // Licensed under the Apache License, Version 2.0 (the "License");
20 // you may not use this file except in compliance with the License.
21 // You may obtain a copy of the License at
22 //
23 // http://www.apache.org/licenses/LICENSE-2.0
24 //
25 // Unless required by applicable law or agreed to in writing, software
26 // distributed under the License is distributed on an "AS IS" BASIS,
27 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 // See the License for the specific language governing permissions and
29 // limitations under the License.
30 */
31 
32 #ifndef INCLUDED_AnnotationMacrosC_h_GUID_48538D9B_35E3_4E9A_D2B0_D83D51DD5900
33 #define INCLUDED_AnnotationMacrosC_h_GUID_48538D9B_35E3_4E9A_D2B0_D83D51DD5900
34 
35 #ifndef OSVR_DISABLE_ANALYSIS
36 
37 #if defined(_MSC_VER) && (_MSC_VER >= 1700)
38 /* Visual C++ (2012 and newer) */
39 /* Using SAL attribute format:
40  * http://msdn.microsoft.com/en-us/library/ms182032(v=vs.120).aspx */
41 
42 #include <sal.h>
43 
44 #define OSVR_IN _In_
45 #define OSVR_IN_PTR _In_
46 #define OSVR_IN_OPT _In_opt_
47 #define OSVR_IN_STRZ _In_z_
48 #define OSVR_IN_READS(NUM_ELEMENTS) _In_reads_(NUM_ELEMENTS)
49 
50 #define OSVR_OUT _Out_
51 #define OSVR_OUT_PTR _Outptr_
52 #define OSVR_OUT_OPT _Out_opt_
53 
54 #define OSVR_INOUT _Inout_
55 #define OSVR_INOUT_PTR _Inout_
56 
57 #define OSVR_RETURN_WARN_UNUSED _Must_inspect_result_
58 #define OSVR_RETURN_SUCCESS_CONDITION(X) _Return_type_success_(X)
59 
60 /* end of msvc section */
61 #elif defined(__GNUC__) && (__GNUC__ >= 4)
62 /* section for GCC and GCC-alikes */
63 
64 #if defined(__clang__)
65 /* clang-specific section */
66 #endif
67 
68 #define OSVR_FUNC_NONNULL(X) __attribute__((__nonnull__ X))
69 #define OSVR_RETURN_WARN_UNUSED __attribute__((warn_unused_result))
70 
71 /* end of gcc section and compiler detection */
72 #endif
73 
74 /* end of ndef disable analysis */
75 #endif
76 
77 /* Fallback declarations */
99 #ifndef OSVR_IN
100 #define OSVR_IN
101 #endif
102 
107 #ifndef OSVR_IN_PTR
108 #define OSVR_IN_PTR
109 #endif
110 
115 #ifndef OSVR_IN_OPT
116 #define OSVR_IN_OPT
117 #endif
118 
123 #ifndef OSVR_IN_STRZ
124 #define OSVR_IN_STRZ
125 #endif
126 
133 #ifndef OSVR_IN_READS
134 #define OSVR_IN_READS(NUM_ELEMENTS)
135 #endif
136 
142 #ifndef OSVR_OUT
143 #define OSVR_OUT
144 #endif
145 
150 #ifndef OSVR_OUT_PTR
151 #define OSVR_OUT_PTR
152 #endif
153 
158 #ifndef OSVR_OUT_OPT
159 #define OSVR_OUT_OPT
160 #endif
161 
169 #ifndef OSVR_INOUT
170 #define OSVR_INOUT
171 #endif
172 
177 #ifndef OSVR_INOUT_PTR
178 #define OSVR_INOUT_PTR
179 #endif
180 
181 /* End of parameter annotations. */
201 #ifndef OSVR_FUNC_NONNULL
202 #define OSVR_FUNC_NONNULL(X)
203 #endif
204 
212 #ifndef OSVR_RETURN_WARN_UNUSED
213 #define OSVR_RETURN_WARN_UNUSED
214 #endif
215 /* End of function annotations. */
226 #ifndef OSVR_RETURN_SUCCESS_CONDITION
227 #define OSVR_RETURN_SUCCESS_CONDITION(X)
228 #endif
229 
230 /* End of annotation group. */
232 #endif
Dummy header to substitute for SAL when on a non-MSVC compiler.