at 17.09-beta 84 lines 2.7 kB view raw
1diff --git a/build/openal.cbd b/build/openal.cbd 2index d18e62d..74af061 100644 3--- a/build/openal.cbd 4+++ b/build/openal.cbd 5@@ -23,7 +23,7 @@ CFLAGS += ' -DUSE_OPENAL' 6 # -- 7 8 do ifplat unix 9- LDFLAGS += ' `openal-config --libs`' 10+ LDFLAGS += ' -lopenal' 11 else 12 LDFLAGS += ' -lOpenAL32' 13 done 14diff --git a/build/alleggl.cbd b/build/alleggl.cbd 15index e2708ff..e826371 100644 16--- a/build/alleggl.cbd 17+++ b/build/alleggl.cbd 18@@ -22,7 +22,7 @@ CFLAGS += ' -DUSE_ALLEGROGL' 19 20 # -- 21 22-LIBAGL = agl 23+LIBAGL = alleggl 24 25 ifopt debug LIBAGL = 'agld' 26 27diff --git a/src/apu.cpp b/src/apu.cpp 28index af59f1c..893a798 100644 29--- a/src/apu.cpp 30+++ b/src/apu.cpp 31@@ -1930,7 +1930,7 @@ static void amplify(real& sample) 32 gain -= releaseRate; 33 } 34 35- real output = (1.0 / max(gain, EPSILON)); 36+ real output = (1.0 / MAX(gain, EPSILON)); 37 output = fixf(output, apu_agc_gain_floor, apu_agc_gain_ceiling); 38 sample *= output; 39 } 40diff --git a/src/audio.cpp b/src/audio.cpp 41index b9650dc..c21c05e 100644 42--- a/src/audio.cpp 43+++ b/src/audio.cpp 44@@ -7,6 +7,7 @@ 45 You must read and accept the license prior to use. */ 46 47 #include <allegro.h> 48+#include <cstdio> 49 #include <cstdlib> 50 #include <cstring> 51 #include <vector> 52@@ -234,7 +235,7 @@ void audio_update(void) 53 const unsigned queuedFrames = (audioQueue.size() / audio_channels); 54 if(queuedFrames > 0) { 55 // Determine how many frames we want to make room for. 56- const unsigned framesToAdd = min(queuedFrames, audio_buffer_size_frames); 57+ const unsigned framesToAdd = MIN(queuedFrames, audio_buffer_size_frames); 58 // Make room for the frames in the buffer. 59 const unsigned framesToMove = (audioBufferedFrames - framesToAdd); 60 if(framesToMove > 0) { 61@@ -258,7 +259,7 @@ void audio_update(void) 62 // Determine how many frames are available in the buffer. 63 const unsigned bufferableFrames = (audio_buffer_size_frames - audioBufferedFrames); 64 // Determine the number of frames to copy to the buffer. 65- const unsigned framesToCopy = min(queuedFrames, bufferableFrames); 66+ const unsigned framesToCopy = MIN(queuedFrames, bufferableFrames); 67 68 // Copy frames to the buffer. 69 for(unsigned frame = 0; frame < framesToCopy; frame++) { 70diff --git a/src/include/common.h b/src/include/common.h 71index be28795..e2d21d1 100644 72--- a/src/include/common.h 73+++ b/src/include/common.h 74@@ -41,8 +41,10 @@ extern "C" { 75 #define true TRUE 76 #define false FALSE 77 78+/* 79 #define min(x,y) MIN((x),(y)) 80 #define max(x,y) MAX((x),(y)) 81+*/ 82 83 #define true_or_false(x) ((x) ? true : false) 84