Skip to content

Commit

Permalink
applied changes for more generic os x support
Browse files Browse the repository at this point in the history
  • Loading branch information
bwagner committed Nov 18, 2012
1 parent 47d9201 commit 3b8544d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
15 changes: 8 additions & 7 deletions audio.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@
#ifdef _WIN32
#include <io.h>
#else
# ifndef __MACOSX__
# ifndef __APPLE__
# include <sys/io.h>
# endif
#endif

#include <fcntl.h>

#ifndef __MACOSX__
#ifndef __APPLE__
#include <malloc.h>
#endif

Expand Down Expand Up @@ -100,7 +100,7 @@ FILE* fmkstemp(char *template) {
#define READ_U16_BE(buf) \
(((buf)[0]<<8)|((buf)[1]&0xff))

#ifdef __MACOSX__
#ifdef __APPLE__
#define READ_D64 read_d64_be
#define WRITE_D64 write_d64_be
#else
Expand Down Expand Up @@ -155,6 +155,7 @@ __inline long int lrint(double flt)

return intgr;
}
/* We're not touching this as we don't want these assembler routines on GHz Intel Core i7 */
#elif (defined (__MACOSX__))
#define lrint double2int
inline static long
Expand Down Expand Up @@ -841,7 +842,7 @@ long wav_read(void *in, double **buffer, int samples, int fast, int chunk)
}
}
else if (f->samplesize==16) {
#ifdef __MACOSX__
#ifdef __APPLE__
if (f->bigendian != machine_endianness) {
#else
if (f->bigendian == machine_endianness) {
Expand All @@ -861,7 +862,7 @@ long wav_read(void *in, double **buffer, int samples, int fast, int chunk)
}
}
else if (f->samplesize == 24) {
#ifdef __MACOSX__
#ifdef __APPLE__
if (f->bigendian != machine_endianness) {
#else
if (f->bigendian == machine_endianness) {
Expand All @@ -881,7 +882,7 @@ long wav_read(void *in, double **buffer, int samples, int fast, int chunk)
}
}
else if (f->samplesize == 32) {
#ifdef __MACOSX__
#ifdef __APPLE__
if (f->bigendian != machine_endianness) {
#else
if (f->bigendian == machine_endianness) {
Expand Down Expand Up @@ -1354,7 +1355,7 @@ int write_audio_16bit(audio_file *aufile, void *sample_buffer, unsigned int samp

aufile->samples += samples;

#ifdef __MACOSX__
#ifdef __APPLE__
if (aufile->endianness != machine_endianness) {
#else
if (aufile->endianness == machine_endianness) {
Expand Down
2 changes: 1 addition & 1 deletion config.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
/* Define according to endianness of CPU - PC = LITTLE, APPLE/MAC = BIG, etc. */
#define LITTLE 0
#define BIG 1
#ifdef __MACOSX__
#ifdef __APPLE__
# define machine_endianness BIG
#else
# define machine_endianness LITTLE
Expand Down
4 changes: 2 additions & 2 deletions wavegain.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@
#include <io.h>
#include <process.h>
#else
# ifndef __MACOSX__
# ifndef __APPLE__
# include <sys/io.h>
# endif
#endif

#include <fcntl.h>

#ifndef __MACOSX__
#ifndef __APPLE__
#include <malloc.h>
#endif

Expand Down

0 comments on commit 3b8544d

Please sign in to comment.