]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.13] gh-129539: Include sysexits.h before checking EX_OK (#129590)
authorCollin Funk <collin.funk1@gmail.com>
Sun, 2 Feb 2025 18:37:32 +0000 (10:37 -0800)
committerGitHub <noreply@github.com>
Sun, 2 Feb 2025 18:37:32 +0000 (19:37 +0100)
Previously, the macro would be redefined when the header was included.

Misc/NEWS.d/next/Build/2025-02-02-09-11-45.gh-issue-129539.SYXXCg.rst [new file with mode: 0644]
Modules/posixmodule.c

diff --git a/Misc/NEWS.d/next/Build/2025-02-02-09-11-45.gh-issue-129539.SYXXCg.rst b/Misc/NEWS.d/next/Build/2025-02-02-09-11-45.gh-issue-129539.SYXXCg.rst
new file mode 100644 (file)
index 0000000..9781dc0
--- /dev/null
@@ -0,0 +1 @@
+Don't redefine ``EX_OK`` when the system has the ``sysexits.h`` header.
index 6b2cb96629dc6c622f56e51ce6baafe686ce3792..40d0f86e6aecddfc4d7dd46d44748a7dc094daa2 100644 (file)
 #  include "winreparse.h"
 #endif
 
-#if !defined(EX_OK) && defined(EXIT_SUCCESS)
-#  define EX_OK EXIT_SUCCESS
-#endif
-
 #ifdef __APPLE__
  /* Needed for the implementation of os.statvfs */
 #  include <sys/param.h>
@@ -292,6 +288,10 @@ corresponding Unix manual entries for more information on calls.");
 #  include <sysexits.h>
 #endif
 
+#if !defined(EX_OK) && defined(EXIT_SUCCESS)
+#  define EX_OK EXIT_SUCCESS
+#endif
+
 #ifdef HAVE_SYS_LOADAVG_H
 #  include <sys/loadavg.h>
 #endif