Skip to content

Instantly share code, notes, and snippets.

@feuvan
Created February 4, 2013 05:10
Show Gist options
  • Save feuvan/4705123 to your computer and use it in GitHub Desktop.
Save feuvan/4705123 to your computer and use it in GitHub Desktop.
mp4split-2.2.0 OSX build support
#if defined(WIN32)
#elif defined(__MACH__)
static inline unsigned short bswap_16(unsigned short x) {
return (x>>8) | (x<<8);
}
static inline unsigned int bswap_32(unsigned int x) {
return (bswap_16(x&0xffff)<<16) | (bswap_16(x>>16));
}
static inline unsigned long long bswap_64(unsigned long long x) {
return (((unsigned long long)bswap_32(x&0xffffffffull))<<32) |
(bswap_32(x>>32));
}
#else
#include <byteswap.h>
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment