Skip to content

Commit c928eaf

Browse files
committed
Merge pull request #1 from bwagner/master
fix compatibility issues on Mac OS X
2 parents 4a45446 + 3b8544d commit c928eaf

File tree

6 files changed

+11
-10
lines changed

6 files changed

+11
-10
lines changed

audio.c

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,14 @@
3535
#ifdef _WIN32
3636
#include <io.h>
3737
#else
38-
# ifndef __MACOSX__
38+
# ifndef __APPLE__
3939
# include <sys/io.h>
4040
# endif
4141
#endif
4242

4343
#include <fcntl.h>
4444

45-
#ifndef __MACOSX__
45+
#ifndef __APPLE__
4646
#include <malloc.h>
4747
#endif
4848

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

103-
#ifdef __MACOSX__
103+
#ifdef __APPLE__
104104
#define READ_D64 read_d64_be
105105
#define WRITE_D64 write_d64_be
106106
#else
@@ -155,6 +155,7 @@ __inline long int lrint(double flt)
155155

156156
return intgr;
157157
}
158+
/* We're not touching this as we don't want these assembler routines on GHz Intel Core i7 */
158159
#elif (defined (__MACOSX__))
159160
#define lrint double2int
160161
inline static long
@@ -841,7 +842,7 @@ long wav_read(void *in, double **buffer, int samples, int fast, int chunk)
841842
}
842843
}
843844
else if (f->samplesize==16) {
844-
#ifdef __MACOSX__
845+
#ifdef __APPLE__
845846
if (f->bigendian != machine_endianness) {
846847
#else
847848
if (f->bigendian == machine_endianness) {
@@ -861,7 +862,7 @@ long wav_read(void *in, double **buffer, int samples, int fast, int chunk)
861862
}
862863
}
863864
else if (f->samplesize == 24) {
864-
#ifdef __MACOSX__
865+
#ifdef __APPLE__
865866
if (f->bigendian != machine_endianness) {
866867
#else
867868
if (f->bigendian == machine_endianness) {
@@ -881,7 +882,7 @@ long wav_read(void *in, double **buffer, int samples, int fast, int chunk)
881882
}
882883
}
883884
else if (f->samplesize == 32) {
884-
#ifdef __MACOSX__
885+
#ifdef __APPLE__
885886
if (f->bigendian != machine_endianness) {
886887
#else
887888
if (f->bigendian == machine_endianness) {
@@ -1354,7 +1355,7 @@ int write_audio_16bit(audio_file *aufile, void *sample_buffer, unsigned int samp
13541355

13551356
aufile->samples += samples;
13561357

1357-
#ifdef __MACOSX__
1358+
#ifdef __APPLE__
13581359
if (aufile->endianness != machine_endianness) {
13591360
#else
13601361
if (aufile->endianness == machine_endianness) {

config.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@
107107
/* Define according to endianness of CPU - PC = LITTLE, APPLE/MAC = BIG, etc. */
108108
#define LITTLE 0
109109
#define BIG 1
110-
#ifdef __MACOSX__
110+
#ifdef __APPLE__
111111
# define machine_endianness BIG
112112
#else
113113
# define machine_endianness LITTLE
File renamed without changes.
File renamed without changes.
File renamed without changes.

wavegain.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,14 @@
3434
#include <io.h>
3535
#include <process.h>
3636
#else
37-
# ifndef __MACOSX__
37+
# ifndef __APPLE__
3838
# include <sys/io.h>
3939
# endif
4040
#endif
4141

4242
#include <fcntl.h>
4343

44-
#ifndef __MACOSX__
44+
#ifndef __APPLE__
4545
#include <malloc.h>
4646
#endif
4747

0 commit comments

Comments
 (0)