[3.13] gh-129539: Include sysexits.h before checking EX_OK (#129590)

Previously, the macro would be redefined when the header was included.
This commit is contained in:
Collin Funk 2025-02-02 10:37:32 -08:00 committed by GitHub
parent 63cae73797
commit 65f3432ac3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 4 deletions

View file

@ -0,0 +1 @@
Don't redefine ``EX_OK`` when the system has the ``sysexits.h`` header.

View file

@ -52,10 +52,6 @@
# 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