nuttx-apps/interpreters/python/patch/0019-undef-get_errno-set_errno-to-avoid-nuttx-macro-coll.patch
Tiago Medicci 58b780c280 interpreters/python: Add ctypes prototype patches for NuttX
Integrate NuttX-specific ctypes and posixmodule updates.

Signed-off-by: Tiago Medicci <tiago.medicci@espressif.com>
2026-05-22 21:51:31 +08:00

17 lines
435 B
Diff

--- a/Modules/_ctypes/callproc.c
+++ b/Modules/_ctypes/callproc.c
@@ -91,6 +91,14 @@
#include <alloca.h>
#endif
+/* NuttX errno.h defines get_errno() and set_errno(e) as macros.
+ Undef them so that CPython's static functions of the same name
+ in this file compile without conflict. */
+#ifdef __NuttX__
+#undef get_errno
+#undef set_errno
+#endif
+
#ifdef _Py_MEMORY_SANITIZER
#include <sanitizer/msan_interface.h>
#endif