summaryrefslogtreecommitdiffstats
path: root/src/portaudio-1-fixes-crlf.patch
blob: 498b7ad84d3cf267c25474afc084b765fe33fead (plain)
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
This file is part of MXE. See LICENSE.md for licensing information.

Contains ad hoc patches for cross building.

From dfa2eeb14b92d2bbaf1f6916b2d154b98719d470 Mon Sep 17 00:00:00 2001
From: MXE
Date: Tue, 30 Jun 2015 21:20:47 -0400
Subject: [PATCH 1/4] configure: Fix wdmks source file path


diff --git a/configure.in b/configure.in
index 305b64e..3f3b31e 100644
--- a/configure.in
+++ b/configure.in
@@ -318,7 +318,7 @@ case "${host_os}" in
 
         if [[ "x$with_wdmks" = "xyes" ]]; then
             DXDIR="$with_dxdir"
-            add_objects src/hostapi/wdmks/pa_win_wdmks.o src/common/pa_ringbuffer.o src/os/win/pa_win_hostapis.o src/os/win/pa_win_util.o src/os/win/pa_win_wdmks_util.o src/os/win/pa_win_waveformat.o
+            add_objects src/hostapi/wdmks/pa_win_wdmks.o src/common/pa_ringbuffer.o src/os/win/pa_win_hostapis.o src/os/win/pa_win_util.o src/os/win/pa_win_wdmks_utils.o src/os/win/pa_win_waveformat.o
             LIBS="${LIBS} -lwinmm -lm -luuid -lsetupapi -lole32"
             DLL_LIBS="${DLL_LIBS} -lwinmm -lm -L$DXDIR/lib -luuid -lsetupapi -lole32"
             #VC98="\"/c/Program Files/Microsoft Visual Studio/VC98/Include\""
-- 
1.9.1


From 19e458bb064fbccadecced9c20f5c05c65018c2c Mon Sep 17 00:00:00 2001
From: MXE
Date: Tue, 30 Jun 2015 21:21:17 -0400
Subject: [PATCH 2/4] pa_win_ds: Add shim for macro


diff --git a/src/hostapi/dsound/pa_win_ds.c b/src/hostapi/dsound/pa_win_ds.c
index 98afb5c..2b24981 100644
--- a/src/hostapi/dsound/pa_win_ds.c
+++ b/src/hostapi/dsound/pa_win_ds.c
@@ -876,6 +876,9 @@ static PaError AddOutputDeviceInfoFromDirectSound(
                             case DSSPEAKER_STEREO:           count = 2; break;
                             case DSSPEAKER_SURROUND:         count = 4; break;
                             case DSSPEAKER_5POINT1:          count = 6; break;
+#ifndef DSSPEAKER_7POINT1
+#define DSSPEAKER_7POINT1 0x00000007
+#endif
                             case DSSPEAKER_7POINT1:          count = 8; break;
 #ifndef DSSPEAKER_7POINT1_SURROUND
 #define DSSPEAKER_7POINT1_SURROUND 0x00000008
@@ -2108,7 +2111,8 @@ static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi,
         }
         else
         {
-            CalculateBufferSettings( &stream->hostBufferSizeFrames, &pollingPeriodFrames,
+            CalculateBufferSettings( (unsigned long*)&stream->hostBufferSizeFrames,
+                    &pollingPeriodFrames,
                     /* isFullDuplex = */ (inputParameters && outputParameters),
                     suggestedInputLatencyFrames,
                     suggestedOutputLatencyFrames, 
-- 
1.9.1


From 65b0f52b1a450a7a773ec6cf6a76822e665ed266 Mon Sep 17 00:00:00 2001
From: MXE
Date: Tue, 30 Jun 2015 21:21:38 -0400
Subject: [PATCH 3/4] pa_win_wdmks: Remove extraneous winioctl.h inclusion

This caused compilation failure on mingw-w64.

http://music.columbia.edu/pipermail/portaudio/2015-June/016833.html

diff --git a/src/hostapi/wdmks/pa_win_wdmks.c b/src/hostapi/wdmks/pa_win_wdmks.c
index f969e14..5fca590 100644
--- a/src/hostapi/wdmks/pa_win_wdmks.c
+++ b/src/hostapi/wdmks/pa_win_wdmks.c
@@ -87,7 +87,6 @@ of a device for the duration of active stream using those devices
 #include "pa_win_wdmks.h"
 
 #include <windows.h>
-#include <winioctl.h>
 #include <process.h>
 
 #include <math.h>
-- 
1.9.1


From 4cec0d1cc47fcf3dd71fded3678282981d5d4f74 Mon Sep 17 00:00:00 2001
From: MXE
Date: Tue, 30 Jun 2015 21:25:55 -0400
Subject: [PATCH 4/4] pa_win_wasapi: Fix compilation on mingw-w64


diff --git a/configure.in b/configure.in
index 3f3b31e..dc84918 100644
--- a/configure.in
+++ b/configure.in
@@ -337,7 +337,7 @@ case "${host_os}" in
             add_objects src/hostapi/wasapi/pa_win_wasapi.o src/common/pa_ringbuffer.o src/os/win/pa_win_hostapis.o src/os/win/pa_win_util.o src/os/win/pa_win_coinitialize.o src/os/win/pa_win_waveformat.o
             LIBS="${LIBS} -lwinmm -lm -lole32 -luuid"
             DLL_LIBS="${DLL_LIBS} -lwinmm -lole32"
-            CFLAGS="$CFLAGS -I\$(top_srcdir)/src/hostapi/wasapi/mingw-include -UPA_USE_WASAPI -DPA_USE_WASAPI=1"
+            CFLAGS="$CFLAGS -UPA_USE_WASAPI -DPA_USE_WASAPI=1"
         fi
         ;;
 
diff --git a/src/hostapi/wasapi/pa_win_wasapi.c b/src/hostapi/wasapi/pa_win_wasapi.c
index aecdd63..a9473b9 100644
--- a/src/hostapi/wasapi/pa_win_wasapi.c
+++ b/src/hostapi/wasapi/pa_win_wasapi.c
@@ -49,14 +49,15 @@
 #include <assert.h>
 #include <mmsystem.h>
 #include <mmreg.h>  // must be before other Wasapi headers
-#if defined(_MSC_VER) && (_MSC_VER >= 1400)
-	#include <Avrt.h>
+#if defined(_MSC_VER) && (_MSC_VER >= 1400) || defined(__MINGW64_VERSION_MAJOR)
+	#include <avrt.h>
 	#define COBJMACROS
-	#include <Audioclient.h>
+	#include <audioclient.h>
 	#include <endpointvolume.h>
 	#define INITGUID // Avoid additional linkage of static libs, excessive code will be optimized out by the compiler
-	#include <mmdeviceapi.h>
+	#include <functiondiscoverykeys_devpkey.h>
 	#include <functiondiscoverykeys.h>
+	#include <mmdeviceapi.h>
     #include <devicetopology.h>	// Used to get IKsJackDescription interface
 	#undef INITGUID
 #endif
-- 
1.9.1