Skip to content

Commit

Permalink
SDL_config: Define HAVE_MALLOC_H on glibc-based platforms
Browse files Browse the repository at this point in the history
Version 3.7.4 of the Freespace 2 Source Code Project is known to rely
on SDL having checked for this, and won't see a declaration of
malloc_usable_size() if we don't.

This is a workaround for source compatibility with classic SDL 1.2:
if a game wants to use functions from a particular system header file,
it should be that game's responsibility to check for the header file
itself.

Bug-Debian: https://bugs.debian.org/1012232#58
Signed-off-by: Simon McVittie <[email protected]>
  • Loading branch information
smcv authored and slouken committed Jun 27, 2023
1 parent ed188b5 commit be0b7f9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion include/SDL/SDL_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,13 @@ stage, though. Send patches if your platform lacks something. */
#endif
#endif

#if defined(__GLIBC__)
/* glibc certainly includes this, send patches if your OS does too */
#define HAVE_MALLOC_H 1
#endif

/* things that aren't necessarily in Linux, some are MSVC C runtime, some are BSD. Send patches. */
#if 0
#define HAVE_MALLOC_H 1
#define HAVE_BCOPY 1
#define HAVE_ATOI 1
#define HAVE_ATOF 1
Expand Down

0 comments on commit be0b7f9

Please sign in to comment.