mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2024-11-28 23:13:02 +00:00
fixed MXE once and for all
thanks to @fgsfdsfgs, this is the final thing needed for MXE support
This commit is contained in:
parent
385e396feb
commit
0402ad463b
1 changed files with 18 additions and 4 deletions
|
@ -3,14 +3,28 @@
|
||||||
|
|
||||||
#include "ultratypes.h"
|
#include "ultratypes.h"
|
||||||
|
|
||||||
// Old deprecated functions from strings.h, replaced by memcpy/memset.
|
// old bstring functions that aren't present on some platforms
|
||||||
#ifdef NO_BZERO
|
|
||||||
|
#if defined(__APPLE__)
|
||||||
|
|
||||||
|
// macOS libc has them
|
||||||
|
#include <strings.h>
|
||||||
|
|
||||||
|
#elif defined(_POSIX_C_SOURCE) && (_POSIX_C_SOURCE >= 200809L)
|
||||||
|
|
||||||
|
// there's no way that shit's defined, use memcpy/memset
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#define bzero(buf, size) memset((buf), 0, (size))
|
#undef bzero
|
||||||
#define bcopy(src, dst, size) memcpy((dst), (src), (size))
|
#undef bcopy
|
||||||
|
#define bzero(buf, len) memset((buf), 0, (len))
|
||||||
|
#define bcopy(src, dst, len) memcpy((dst), (src), (len))
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
|
// hope for the best
|
||||||
extern void bcopy(const void *, void *, size_t);
|
extern void bcopy(const void *, void *, size_t);
|
||||||
extern void bzero(void *, size_t);
|
extern void bzero(void *, size_t);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* !_OS_LIBC_H_ */
|
#endif /* !_OS_LIBC_H_ */
|
||||||
|
|
Loading…
Reference in a new issue