From ebfba54fe3620d17b359f443f8ddbfa07be1d327 Mon Sep 17 00:00:00 2001 From: Erwin de Haan Date: Mon, 28 Dec 2015 14:11:45 +0100 Subject: [PATCH] Fixed build errors on VS2013 and earlier. Added inline redefine. Fixed conflict with winioctl.h --- ALAC/codec/ALACBitUtilities.h | 5 ++--- ALAC/codec/ag_dec.c | 4 ++++ ALAC/codec/ag_enc.c | 4 ++++ ALAC/codec/dp_dec.c | 4 ++++ ALAC/codec/dp_enc.c | 4 ++++ binding.cc | 2 +- 6 files changed, 19 insertions(+), 4 deletions(-) diff --git a/ALAC/codec/ALACBitUtilities.h b/ALAC/codec/ALACBitUtilities.h index 97e9ebe..38777c6 100644 --- a/ALAC/codec/ALACBitUtilities.h +++ b/ALAC/codec/ALACBitUtilities.h @@ -55,8 +55,7 @@ enum typedef enum -{ - +{ ID_SCE = 0, /* Single Channel Element */ ID_CPE = 1, /* Channel Pair Element */ ID_CCE = 2, /* Coupling Channel Element */ @@ -65,7 +64,7 @@ typedef enum ID_PCE = 5, ID_FIL = 6, ID_END = 7 -} ELEMENT_TYPE; +} AELEMENT_TYPE; // types typedef struct BitBuffer diff --git a/ALAC/codec/ag_dec.c b/ALAC/codec/ag_dec.c index 2214c94..9bdae1c 100644 --- a/ALAC/codec/ag_dec.c +++ b/ALAC/codec/ag_dec.c @@ -53,6 +53,10 @@ #define ALWAYS_INLINE #endif +#ifdef _MSC_VER +#define inline __inline +#endif + /* And on the subject of the CodeWarrior x86 compiler and inlining, I reworked a lot of this to help the compiler out. In many cases this required manual inlining or a macro. Sorry if it is ugly but the performance gains are well worth it. diff --git a/ALAC/codec/ag_enc.c b/ALAC/codec/ag_enc.c index 2dfe999..7ec2362 100644 --- a/ALAC/codec/ag_enc.c +++ b/ALAC/codec/ag_enc.c @@ -54,6 +54,10 @@ #define ALWAYS_INLINE #endif +#ifdef _MSC_VER +#define inline __inline +#endif + /* And on the subject of the CodeWarrior x86 compiler and inlining, I reworked a lot of this to help the compiler out. In many cases this required manual inlining or a macro. Sorry diff --git a/ALAC/codec/dp_dec.c b/ALAC/codec/dp_dec.c index d153025..3f69704 100644 --- a/ALAC/codec/dp_dec.c +++ b/ALAC/codec/dp_dec.c @@ -36,6 +36,10 @@ #define ALWAYS_INLINE #endif +#ifdef _MSC_VER +#define inline __inline +#endif + #if TARGET_CPU_PPC && (__MWERKS__ >= 0x3200) // align loops to a 16 byte boundary to make the G5 happy #pragma function_align 16 diff --git a/ALAC/codec/dp_enc.c b/ALAC/codec/dp_enc.c index 869104c..9e93c39 100644 --- a/ALAC/codec/dp_enc.c +++ b/ALAC/codec/dp_enc.c @@ -35,6 +35,10 @@ #define ALWAYS_INLINE #endif +#ifdef _MSC_VER +#define inline __inline +#endif + #if TARGET_CPU_PPC && (__MWERKS__ >= 0x3200) // align loops to a 16 byte boundary to make the G5 happy #pragma function_align 16 diff --git a/binding.cc b/binding.cc index bea91a6..72915a6 100644 --- a/binding.cc +++ b/binding.cc @@ -121,7 +121,7 @@ class Encoder : public Nan::ObjectWrap // Build cookie buffer. uint32_t cookieSize = e->enc_.GetMagicCookieSize(e->outf_.mChannelsPerFrame); - char cookie[cookieSize]; + char* cookie = (char*)alloca(sizeof(char) * (cookieSize)); e->enc_.GetMagicCookie(cookie, &cookieSize); // Init self.