summaryrefslogtreecommitdiffstats
path: root/Include/pymacro.h
diff options
context:
space:
mode:
Diffstat (limited to 'Include/pymacro.h')
-rw-r--r--Include/pymacro.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/Include/pymacro.h b/Include/pymacro.h
index 202b936..2728496 100644
--- a/Include/pymacro.h
+++ b/Include/pymacro.h
@@ -129,4 +129,8 @@
Py_FatalError("Unreachable C code path reached")
#endif
+// Prevent using an expression as a l-value.
+// For example, "int x; _Py_RVALUE(x) = 1;" fails with a compiler error.
+#define _Py_RVALUE(EXPR) ((void)0, (EXPR))
+
#endif /* Py_PYMACRO_H */