Skip to content

Commit

Permalink
Fix compilation on new macOS and new clang
Browse files Browse the repository at this point in the history
  • Loading branch information
JulianSlzr committed Dec 6, 2017
1 parent de032cb commit 9397238
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions src/configure
Original file line number Diff line number Diff line change
Expand Up @@ -654,8 +654,10 @@ if [ "`uname`" == "Darwin" ]; then
fi
# posix_memalign and gcc -rdynamic options not present on OS X 10.5.*
osx_ver=`sw_vers | grep ProductVersion | awk '{print $2}' | awk '{split($0,a,"\."); print a[1] "." a[2]; }'`
echo "Configuring for OS X version $osx_ver ..."
if [ "$osx_ver" == "10.5" ]; then
echo "Configuring for macOS version $osx_ver ..."
if [ "$osx_ver" == "10.0" ] || [ "$osx_ver" == "10.1" ] || [ "$osx_ver" == "10.2" ] || [ "$osx_ver" == "10.3" ] || [ "$osx_ver" == "10.4" ]; then
failure "macOS version must be at least 10.5"
elif [ "$osx_ver" == "10.5" ]; then
check_exists makefiles/darwin_10_5.mk
cat makefiles/darwin_10_5.mk >> config.mk
elif [ "$osx_ver" == "10.6" ]; then
Expand All @@ -673,11 +675,11 @@ if [ "`uname`" == "Darwin" ]; then
elif [ "$osx_ver" == "10.10" ]; then
check_exists makefiles/darwin_10_10.mk
cat makefiles/darwin_10_10.mk >> config.mk
elif [ "$osx_ver" == "10.11" ]; then
elif [[ "$osx_ver" == 10.* ]]; then
check_exists makefiles/darwin_10_11.mk
cat makefiles/darwin_10_11.mk >> config.mk
else
failure "OS X version '$osx_ver' not supported"
failure "macOS version '$osx_ver' not supported"
fi
echo "Configuration succeeded for platform Darwin."
exit_success;
Expand Down
2 changes: 1 addition & 1 deletion src/lat/push-lattice.cc
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ template<class Weight, class IntType> class CompactLatticePusher {
// if there is conflict, and if so, reduce the "shift".
bool is_final = (final != CompactWeight::Zero());
size_t num_arcs = clat_->NumArcs(state);
if (num_arcs + (is_final ? 1 : 0) > 1 && shift > 0) {
if (num_arcs + (is_final ? 1 : 0) > 1 && shift > (void *)0) {
// There is potential for conflict between string values, because >1
// [arc or final-prob]. Find the longest shift up to and including the
// current shift, that gives no conflict.
Expand Down

0 comments on commit 9397238

Please sign in to comment.