Skip to content

Commit

Permalink
Audio: work around issue with different typedef for ALbyte on OSX.
Browse files Browse the repository at this point in the history
In OpenAL-Soft (Linux, Windows) `ALbyte` is defined as `signed char`,
while it is defined as `char` on OSX. Don't know why.
  • Loading branch information
mosra committed Oct 26, 2013
1 parent f130ce5 commit ebbefad
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Audio/Audio.cpp
Expand Up @@ -31,7 +31,12 @@ namespace Magnum { namespace Audio {

/* Verify types */
static_assert(std::is_same<ALubyte, UnsignedByte>::value, "ALubyte is not the same as UnsignedByte");
/** @todo Why `ALbyte` is defined as `char` and not `signed char` on OSX? */
#ifndef __APPLE__
static_assert(std::is_same<ALbyte, Byte>::value, "ALbyte is not the same as Byte");
#else
static_assert(std::is_signed<ALbyte>::value && sizeof(ALbyte) == 1, "ALbyte does not have the same characteristics as Byte");
#endif
static_assert(std::is_same<ALushort, UnsignedShort>::value, "ALushort is not the same as UnsignedShort");
static_assert(std::is_same<ALshort, Short>::value, "ALshort is not the same as Short");
static_assert(std::is_same<ALuint, UnsignedInt>::value, "ALuint is not the same as UnsignedInt");
Expand Down

0 comments on commit ebbefad

Please sign in to comment.