File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -174,6 +174,23 @@ complete listing.
174174 This does not use the C11 standard ``_Alignas `` specifier; prefer use of
175175 that over this macro.
176176
177+ .. c :macro :: Py_ARITHMETIC_RIGHT_SHIFT(type, integer, positions)
178+
179+ Similar to :c:expr: `integer >> positions `, but forces sign extension, as the C
180+ standard does not define whether a right-shift of a signed integer will
181+ perform sign extension or a zero-fill.
182+
183+ *integer * should be any signed integer type.
184+ *positions * is the number of positions to shift to the right.
185+
186+ Both *integer * and *positions * can be evaluated more than once;
187+ consequently, avoid directly passing a function call or some other
188+ expensive operation to this macro. Instead, store the result as a
189+ variable and then pass it.
190+
191+ *type * is the type of the expression. In modern versions of Python, this is
192+ unused. Historically, *type * was used to cast *integer *.
193+
177194.. c :macro :: Py_ALWAYS_INLINE
178195
179196 Ask the compiler to always inline a static inline function. The compiler can
You can’t perform that action at this time.
0 commit comments