From 106af5b46a13a057337f9fc809398c35a7c8e83a Mon Sep 17 00:00:00 2001 From: Thaddeus Crews Date: Wed, 30 Jul 2025 10:34:01 -0500 Subject: [PATCH] Define relevant macros when LACKS_ERRNO_H is true (cherry picked from commit 3195980b497edc3d9e78a572b48ec5cc5db45955) --- src/stdlib/SDL_malloc.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/stdlib/SDL_malloc.c b/src/stdlib/SDL_malloc.c index 008675f312..89c28304c6 100644 --- a/src/stdlib/SDL_malloc.c +++ b/src/stdlib/SDL_malloc.c @@ -1478,6 +1478,13 @@ DLMALLOC_EXPORT int mspace_mallopt(int, int); #endif /* NO_MALLOC_STATS */ #ifndef LACKS_ERRNO_H #include /* for MALLOC_FAILURE_ACTION */ +#else /* LACKS_ERRNO_H */ +#ifndef EINVAL +#define EINVAL 22 +#endif +#ifndef ENOMEM +#define ENOMEM 12 +#endif #endif /* LACKS_ERRNO_H */ #ifdef DEBUG #if ABORT_ON_ASSERT_FAILURE