1 /** 2 * This file has no copyright assigned and is placed in the Public Domain. 3 * This file is part of the mingw-w64 runtime package. 4 * No warranty is given; refer to the file DISCLAIMER.PD within this package. 5 */ 6 7 #ifndef SAL_HXX 8 #define SAL_HXX 9 10 #ifdef __GNUC__ 11 # define __inner_checkReturn __attribute__((warn_unused_result)) 12 #elif defined(_MSC_VER) 13 # define __inner_checkReturn __declspec("SAL_checkReturn") 14 #else 15 # define __inner_checkReturn 16 #endif 17 18 #define __checkReturn __inner_checkReturn 19 20 /* Pointer parameters */ 21 #define _In_ 22 #define _Out_ 23 #define _Inout_ 24 #define _In_z_ 25 #define _Inout_z_ 26 #define _In_reads_(s) 27 #define _In_reads_bytes_(s) 28 #define _In_reads_z_(s) 29 #define _In_reads_or_z_(s) 30 #define _Out_writes_(s) 31 #define _Out_writes_bytes_(s) 32 #define _Out_writes_z_(s) 33 #define _Inout_updates_(s) 34 #define _Inout_updates_bytes_(s) 35 #define _Inout_updates_z_(s) 36 #define _Out_writes_to_(s,c) 37 #define _Out_writes_bytes_to_(s, c) 38 #define _Out_writes_all_(s) 39 #define _Out_writes_bytes_all_(s) 40 #define _Inout_updates_to_(s, c) 41 #define _Inout_updates_bytes_to_(s, c) 42 #define _Inout_updates_all_(s) 43 #define _Inout_updates_bytes_all_(s) 44 #define _In_reads_to_ptr_(p) 45 #define _In_reads_to_ptr_z_(p) 46 #define _Out_writes_to_ptr_(p) 47 #define _Out_writes_to_ptr_z(p) 48 49 /* Optional pointer parameters */ 50 #define _In_opt_ 51 #define _Out_opt_ 52 #define _Inout_opt_ 53 #define _In_opt_z_ 54 #define _Inout_opt_z_ 55 #define _In_reads_opt_(s) 56 #define _In_reads_bytes_opt_(s) 57 #define _In_reads_opt_z_(s) 58 59 #define _Out_writes_opt_(s) 60 #define _Out_writes_opt_z_(s) 61 #define _Inout_updates_opt_(s) 62 #define _Inout_updates_bytes_opt_(s) 63 #define _Inout_updates_opt_z_(s) 64 #define _Out_writes_to_opt_(s, c) 65 #define _Out_writes_bytes_to_opt_(s, c) 66 #define _Out_writes_all_opt_(s) 67 #define _Out_writes_bytes_all_opt_(s) 68 69 #define _Inout_updates_to_opt_(s, c) 70 #define _Inout_updates_bytes_to_opt_(s, c) 71 #define _Inout_updates_all_opt_(s) 72 #define _Inout_updates_bytes_all_opt_(s) 73 #define _In_reads_to_ptr_opt_(p) 74 #define _In_reads_to_ptr_opt_z_(p) 75 #define _Out_writes_to_ptr_opt_(p) 76 #define _Out_writes_to_ptr_opt_z_(p) 77 78 /* Output pointer parameters */ 79 #define _Outptr_ 80 #define _Outptr_opt_ 81 #define _Outptr_result_maybenull_ 82 #define _Outptr_opt_result_maybenull_ 83 #define _Outptr_result_z_ 84 #define _Outptr_opt_result_z_ 85 #define _Outptr_result_maybenull_z_ 86 #define _Outptr_opt_result_maybenull_z_ 87 #define _COM_Outptr_ 88 #define _COM_Outptr_opt_ 89 #define _COM_Outptr_result_maybenull_ 90 #define _COM_Outptr_opt_result_maybenull_ 91 #define _Outptr_result_buffer_(s) 92 #define _Outptr_result_bytebuffer_(s) 93 #define _Outptr_opt_result_buffer_(s) 94 #define _Outptr_opt_result_bytebuffer_(s) 95 #define _Outptr_result_buffer_to_(s, c) 96 #define _Outptr_result_bytebuffer_to_(s, c) 97 #define _Outptr_result_bytebuffer_maybenull_(s) 98 #define _Outptr_opt_result_buffer_to_(s, c) 99 #define _Outptr_opt_result_bytebuffer_to_(s, c) 100 #define _Result_nullonfailure_ 101 #define _Result_zeroonfailure_ 102 #define _Outptr_result_nullonfailure_ 103 #define _Outptr_opt_result_nullonfailure_ 104 #define _Outref_result_nullonfailure_ 105 106 /* Output reference parameters */ 107 #define _Outref_ 108 #define _Outref_result_maybenull_ 109 #define _Outref_result_buffer_(s) 110 #define _Outref_result_bytebuffer_(s) 111 #define _Outref_result_buffer_to_(s, c) 112 #define _Outref_result_bytebuffer_to_(s, c) 113 #define _Outref_result_buffer_all_(s) 114 #define _Outref_result_bytebuffer_all_(s) 115 #define _Outref_result_buffer_maybenull_(s) 116 #define _Outref_result_bytebuffer_maybenull_(s) 117 #define _Outref_result_buffer_to_maybenull_(s, c) 118 #define _Outref_result_bytebuffer_to_maybenull_(s, c) 119 #define _Outref_result_buffer_all_maybenull_(s) 120 #define _Outref_result_bytebuffer_all_maybenull_(s) 121 122 /* Return values */ 123 #define _Ret_z_ 124 #define _Ret_writes_(s) 125 #define _Ret_writes_bytes_(s) 126 #define _Ret_writes_z_(s) 127 #define _Ret_writes_bytes_to_(s, c) 128 #define _Ret_writes_maybenull_(s) 129 #define _Ret_writes_to_maybenull_(s, c) 130 #define _Ret_writes_maybenull_z_(s) 131 #define _Ret_maybenull_ 132 #define _Ret_maybenull_z_ 133 #define _Ret_null_ 134 #define _Ret_notnull_ 135 #define _Ret_writes_bytes_to_(s, c) 136 #define _Ret_writes_bytes_maybenull_(s) 137 #define _Ret_writes_bytes_to_maybenull_(s, c) 138 139 /* Other common annotations */ 140 #define _In_range_(low, hi) 141 #define _Out_range_(low, hi) 142 #define _Ret_range_(low, hi) 143 #define _Deref_in_range_(low, hi) 144 #define _Deref_out_range_(low, hi) 145 #define _Deref_inout_range_(low, hi) 146 #define _Pre_equal_to_(expr) 147 #define _Post_equal_to_(expr) 148 #define _Struct_size_bytes_(size) 149 150 /* Function annotations */ 151 #define _Called_from_function_class_(name) 152 #define _Check_return_ __checkReturn 153 #define _Function_class_(name) 154 #define _Raises_SEH_exception_ 155 #define _Maybe_raises_SEH_exception_ 156 #define _Must_inspect_result_ 157 #define _Use_decl_annotations_ 158 159 /* Success/failure annotations */ 160 #define _Always_(anno_list) 161 #define _On_failure_(anno_list) 162 #define _Return_type_success_(expr) 163 #define _Success_(expr) 164 165 #define _Reserved_ 166 #define _Const_ 167 168 /* Buffer properties */ 169 #define _Readable_bytes_(s) 170 #define _Readable_elements_(s) 171 #define _Writable_bytes_(s) 172 #define _Writable_elements_(s) 173 #define _Null_terminated_ 174 #define _NullNull_terminated_ 175 #define _Pre_readable_size_(s) 176 #define _Pre_writable_size_(s) 177 #define _Pre_readable_byte_size_(s) 178 #define _Pre_writable_byte_size_(s) 179 #define _Post_readable_size_(s) 180 #define _Post_writable_size_(s) 181 #define _Post_readable_byte_size_(s) 182 #define _Post_writable_byte_size_(s) 183 184 /* Field properties */ 185 #define _Field_size_(s) 186 #define _Field_size_full_(s) 187 #define _Field_size_full_opt_(s) 188 #define _Field_size_opt_(s) 189 #define _Field_size_part_(s, c) 190 #define _Field_size_part_opt_(s, c) 191 #define _Field_size_bytes_(size) 192 #define _Field_size_bytes_full_(size) 193 #define _Field_size_bytes_full_opt_(s) 194 #define _Field_size_bytes_opt_(s) 195 #define _Field_size_bytes_part_(s, c) 196 #define _Field_size_bytes_part_opt_(s, c) 197 #define _Field_z_ 198 #define _Field_range_(min, max) 199 200 /* Structural annotations */ 201 #define _At_(e, a) 202 #define _At_buffer_(e, i, c, a) 203 #define _Group_(a) 204 #define _When_(e, a) 205 206 /* Analysis */ 207 #define _Analysis_assume_(expr) 208 #define _Analysis_assume_nullterminated_(expr) 209 210 #endif 211 212