Skip to content

Commit d87c024

Browse files
authored
Update macOS version for build workflow (#678)
* Update macOS version for build workflow Update to `macos-15-intel`. Note this is the last intel version before ARM64. See actions/runner-images#13046 for further details. * Use std::vector instead of VLA for MIDI buffer Replaced variable length array with std::vector for buffer.
1 parent 5842e62 commit d87c024

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

.github/workflows/build-osx-wizmode.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ env:
1414
jobs:
1515
build:
1616
# custom libpng build fails a test on macos-latest (11.x)
17-
runs-on: macos-13
17+
runs-on: macos-15-intel
1818
steps:
1919
- uses: actions/checkout@v2
2020
with:

audio/RtMidi.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1032,9 +1032,10 @@ void MidiOutCore :: sendMessage( std::vector<unsigned char> *message )
10321032
return;
10331033
}
10341034

1035-
Byte buffer[nBytes+(sizeof(MIDIPacketList))];
1036-
ByteCount listSize = sizeof(buffer);
1037-
MIDIPacketList *packetList = (MIDIPacketList*)buffer;
1035+
// Replace the buffer VLA with a std::vector-based buffer to avoid VLA.
1036+
std::vector<Byte> bufferVec(nBytes + sizeof(MIDIPacketList));
1037+
ByteCount listSize = static_cast<ByteCount>(bufferVec.size());
1038+
MIDIPacketList *packetList = reinterpret_cast<MIDIPacketList*>(bufferVec.data());
10381039
MIDIPacket *packet = MIDIPacketListInit( packetList );
10391040

10401041
ByteCount remainingBytes = nBytes;

0 commit comments

Comments
 (0)