Skip to content

Commit

Permalink
Build fix - use Qt's endian conversion functions.
Browse files Browse the repository at this point in the history
Bug: #55
  • Loading branch information
cameronwhite committed Jun 21, 2015
1 parent 83a880e commit 8be7501
Showing 1 changed file with 3 additions and 17 deletions.
20 changes: 3 additions & 17 deletions source/formats/midi/midiexporter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,30 +19,16 @@

#include <midi/midifile.h>

#include <QtEndian>

#include <array>
#include <cstdint>
#include <boost/detail/endian.hpp>
#include <fstream>

static uint8_t bswap(uint8_t val)
{
return val;
}

static uint16_t bswap(uint16_t val)
{
return _byteswap_ushort(val);
}

static uint32_t bswap(uint32_t val)
{
return _byteswap_ulong(val);
}

template <typename T>
static void write(std::ostream &os, T val)
{
val = bswap(val);
val = qToBigEndian(val);
os.write(reinterpret_cast<const char *>(&val), sizeof(T));
}

Expand Down

0 comments on commit 8be7501

Please sign in to comment.