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 index 00000000000000..9781dc05b64823 --- /dev/null +++ b/Misc/NEWS.d/next/Build/2025-02-02-09-11-45.gh-issue-129539.SYXXCg.rst @@ -0,0 +1 @@ +Don't redefine ``EX_OK`` when the system has the ``sysexits.h`` header. diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index c386f15b1714e1..c21c6f06c729de 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -49,10 +49,6 @@ # include "winreparse.h" #endif -#if !defined(EX_OK) && defined(EXIT_SUCCESS) -# define EX_OK EXIT_SUCCESS -#endif - /* On android API level 21, 'AT_EACCESS' is not declared although * HAVE_FACCESSAT is defined. */ #ifdef __ANDROID__ @@ -270,6 +266,10 @@ corresponding Unix manual entries for more information on calls."); # include #endif +#if !defined(EX_OK) && defined(EXIT_SUCCESS) +# define EX_OK EXIT_SUCCESS +#endif + #ifdef HAVE_SYS_LOADAVG_H # include #endif