fix Mac OS 10.13 build issues

Compile out the min/max functions in GBALink.cpp when compiling with
clang, clang does not like them because of some sort of changes in the
preprocessor.

Run the mac builder script with homebrew bash, system bash does not work
and dash no longer works.

TODO: fix dash compat
This commit is contained in:
Rafael Kitover 2018-06-17 16:01:40 -07:00
parent 9222894cc4
commit 430b5d638d
3 changed files with 20 additions and 11 deletions

View File

@ -49,6 +49,12 @@ enum siocnt_lo_32bit {
SIO_IRQ_ENABLE = 0x4000
};
#ifdef __clang__
// don't define these min/max functions, they don't compile
#else
// The usual min/max functions for built-in types.
//
// template<typename T> T min( T x, T y ) { return x < y ? x : y; }
@ -80,6 +86,8 @@ BLARGG_DEF_MIN_MAX(double)
#undef max
#define max blargg_max
#endif // not clang
// Joybus
bool gba_joybus_enabled = false;
bool gba_joybus_active = false;

View File

@ -20,6 +20,7 @@ export CXX="\${CXX:-g++}"
case "\$CC" in
ccache*)
:
;;
*)
if command -v ccache >/dev/null; then

View File

@ -1,17 +1,17 @@
#!/bin/sh
#!/usr/local/bin/bash
set -e
# bash 3 does not work for this code
if [ -z "$IN_DASH" ]; then
if command -v dash >/dev/null; then
export IN_DASH=1
exec dash "$0" "$@"
else
echo >&2 "please install dash from homebrew or macports to run this script"
exit 1
fi
fi
## bash 3 does not work for this code
#if [ -z "$IN_DASH" ]; then
# if command -v dash >/dev/null; then
# export IN_DASH=1
# exec dash "$0" "$@"
# else
# echo >&2 "please install dash from homebrew or macports to run this script"
# exit 1
# fi
#fi
BUILD_ROOT=$HOME/vbam-build-mac