mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2024-11-22 12:05:11 +00:00
Merge pull request #132 from coltongit/patch-12
Further fixes to MXE compilation
This commit is contained in:
commit
009aef1da5
2 changed files with 28 additions and 2 deletions
8
Makefile
8
Makefile
|
@ -419,7 +419,13 @@ else
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(WINDOWS_BUILD),1)
|
ifeq ($(WINDOWS_BUILD),1)
|
||||||
LD := $(CXX)
|
ifeq ($(CROSS),i686-w64-mingw32.static-) # fixes compilation in MXE on Linux and WSL
|
||||||
|
LD := $(CC)
|
||||||
|
else ifeq ($(CROSS),x86_64-w64-mingw32.static-)
|
||||||
|
LD := $(CC)
|
||||||
|
else
|
||||||
|
LD := $(CXX)
|
||||||
|
endif
|
||||||
else
|
else
|
||||||
LD := $(CC)
|
LD := $(CC)
|
||||||
endif
|
endif
|
||||||
|
|
|
@ -3,8 +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
|
||||||
|
|
||||||
|
#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>
|
||||||
|
#undef bzero
|
||||||
|
#undef bcopy
|
||||||
|
#define bzero(buf, len) memset((buf), 0, (len))
|
||||||
|
#define bcopy(src, dst, len) memcpy((dst), (src), (len))
|
||||||
|
|
||||||
|
#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 /* !_OS_LIBC_H_ */
|
#endif /* !_OS_LIBC_H_ */
|
||||||
|
|
Loading…
Reference in a new issue