summary refs log tree commit diff
path: root/pkgs/applications/emulators/fakenes/build.patch
blob: 90799d977a144062c0c6be38c29171a35361fa40 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
diff --git a/build/openal.cbd b/build/openal.cbd
index d18e62d..74af061 100644
--- a/build/openal.cbd
+++ b/build/openal.cbd
@@ -23,7 +23,7 @@ CFLAGS += ' -DUSE_OPENAL'
 # --
 
 do ifplat unix
-   LDFLAGS += ' `openal-config --libs`'
+   LDFLAGS += ' -lopenal'
 else
    LDFLAGS += ' -lOpenAL32'
 done
diff --git a/build/alleggl.cbd b/build/alleggl.cbd
index e2708ff..e826371 100644
--- a/build/alleggl.cbd
+++ b/build/alleggl.cbd
@@ -22,7 +22,7 @@ CFLAGS += ' -DUSE_ALLEGROGL'
 
 # --
 
-LIBAGL = agl
+LIBAGL = alleggl
 
 ifopt debug LIBAGL = 'agld'

diff --git a/src/apu.cpp b/src/apu.cpp
index af59f1c..893a798 100644
--- a/src/apu.cpp
+++ b/src/apu.cpp
@@ -1930,7 +1930,7 @@ static void amplify(real& sample)
          gain -= releaseRate;
       }
 
-      real output = (1.0 / max(gain, EPSILON));
+      real output = (1.0 / MAX(gain, EPSILON));
       output = fixf(output, apu_agc_gain_floor, apu_agc_gain_ceiling);
       sample *= output;
    }
diff --git a/src/audio.cpp b/src/audio.cpp
index b9650dc..c21c05e 100644
--- a/src/audio.cpp
+++ b/src/audio.cpp
@@ -7,6 +7,7 @@
    You must read and accept the license prior to use. */
 
 #include <allegro.h>
+#include <cstdio>
 #include <cstdlib>
 #include <cstring>
 #include <vector>
@@ -234,7 +235,7 @@ void audio_update(void)
          const unsigned queuedFrames = (audioQueue.size() / audio_channels);
          if(queuedFrames > 0) {
             // Determine how many frames we want to make room for.
-            const unsigned framesToAdd = min(queuedFrames, audio_buffer_size_frames);
+            const unsigned framesToAdd = MIN(queuedFrames, audio_buffer_size_frames);
             // Make room for the frames in the buffer.
             const unsigned framesToMove = (audioBufferedFrames - framesToAdd);
             if(framesToMove > 0) {
@@ -258,7 +259,7 @@ void audio_update(void)
          // Determine how many frames are available in the buffer.
          const unsigned bufferableFrames = (audio_buffer_size_frames - audioBufferedFrames);
          // Determine the number of frames to copy to the buffer.
-         const unsigned framesToCopy = min(queuedFrames, bufferableFrames);
+         const unsigned framesToCopy = MIN(queuedFrames, bufferableFrames);
 
          // Copy frames to the buffer.
          for(unsigned frame = 0; frame < framesToCopy; frame++) {
diff --git a/src/include/common.h b/src/include/common.h
index be28795..e2d21d1 100644
--- a/src/include/common.h
+++ b/src/include/common.h
@@ -41,8 +41,10 @@ extern "C" {
 #define true   TRUE
 #define false  FALSE
 
+/*
 #define min(x,y)   MIN((x),(y))
 #define max(x,y)   MAX((x),(y))
+*/
 
 #define true_or_false(x)   ((x) ? true : false)