ref: 66fe7de70d3ab468a7cd4229c82ca5839bf05d5c
parent: 1111ed43e82eaea2b93f4e4e99914807fe772776
author: Krzysztof Nikiel <knik@users.sourceforge.net>
date: Sat Oct 7 07:04:03 EDT 2017
renamed ATTR to VISIBLE; added dllexport attribute
--- a/include/neaacdec.h
+++ b/include/neaacdec.h
@@ -60,14 +60,16 @@
#ifdef _WIN32
#pragma pack(push, 8)
- #define CDECL __cdecl
- #define ATTR
+ #ifndef CDECL
+ #define CDECL __cdecl
+ #endif
+ #define VISIBLE __declspec( dllexport )
#elif defined(__GNUC__) && __GNUC__ >= 4
#define CDECL
- #define ATTR __attribute__((visibility("default")))
+ #define VISIBLE __attribute__((visibility("default")))
#else
#define CDECL
- #define ATTR
+ #define VISIBLE
#endif
#define FAAD2_VERSION "unknown"
@@ -199,19 +201,19 @@
unsigned char ps;
} NeAACDecFrameInfo;
-ATTR char* CDECL NeAACDecGetErrorMessage(unsigned char errcode);
+VISIBLE char* CDECL NeAACDecGetErrorMessage(unsigned char errcode);
-ATTR unsigned long CDECL NeAACDecGetCapabilities(void);
+VISIBLE unsigned long CDECL NeAACDecGetCapabilities(void);
-ATTR NeAACDecHandle CDECL NeAACDecOpen(void);
+VISIBLE NeAACDecHandle CDECL NeAACDecOpen(void);
-ATTR NeAACDecConfigurationPtr CDECL NeAACDecGetCurrentConfiguration(NeAACDecHandle hDecoder);
+VISIBLE NeAACDecConfigurationPtr CDECL NeAACDecGetCurrentConfiguration(NeAACDecHandle hDecoder);
-ATTR unsigned char CDECL NeAACDecSetConfiguration(NeAACDecHandle hDecoder,
+VISIBLE unsigned char CDECL NeAACDecSetConfiguration(NeAACDecHandle hDecoder,
NeAACDecConfigurationPtr config);
/* Init the library based on info from the AAC file (ADTS/ADIF) */
-ATTR long CDECL NeAACDecInit(NeAACDecHandle hDecoder,
+VISIBLE long CDECL NeAACDecInit(NeAACDecHandle hDecoder,
unsigned char *buffer,
unsigned long buffer_size,
unsigned long *samplerate,
@@ -218,7 +220,7 @@
unsigned char *channels);
/* Init the library using a DecoderSpecificInfo */
-ATTR char CDECL NeAACDecInit2(NeAACDecHandle hDecoder,
+VISIBLE char CDECL NeAACDecInit2(NeAACDecHandle hDecoder,
unsigned char *pBuffer,
unsigned long SizeOfDecoderSpecificInfo,
unsigned long *samplerate,
@@ -225,19 +227,19 @@
unsigned char *channels);
/* Init the library for DRM */
-ATTR char CDECL NeAACDecInitDRM(NeAACDecHandle *hDecoder, unsigned long samplerate,
+VISIBLE char CDECL NeAACDecInitDRM(NeAACDecHandle *hDecoder, unsigned long samplerate,
unsigned char channels);
-ATTR void CDECL NeAACDecPostSeekReset(NeAACDecHandle hDecoder, long frame);
+VISIBLE void CDECL NeAACDecPostSeekReset(NeAACDecHandle hDecoder, long frame);
-ATTR void CDECL NeAACDecClose(NeAACDecHandle hDecoder);
+VISIBLE void CDECL NeAACDecClose(NeAACDecHandle hDecoder);
-ATTR void* CDECL NeAACDecDecode(NeAACDecHandle hDecoder,
+VISIBLE void* CDECL NeAACDecDecode(NeAACDecHandle hDecoder,
NeAACDecFrameInfo *hInfo,
unsigned char *buffer,
unsigned long buffer_size);
-ATTR void* CDECL NeAACDecDecode2(NeAACDecHandle hDecoder,
+VISIBLE void* CDECL NeAACDecDecode2(NeAACDecHandle hDecoder,
NeAACDecFrameInfo *hInfo,
unsigned char *buffer,
unsigned long buffer_size,
@@ -244,12 +246,12 @@
void **sample_buffer,
unsigned long sample_buffer_size);
-ATTR char CDECL NeAACDecAudioSpecificConfig(unsigned char *pBuffer,
+VISIBLE char CDECL NeAACDecAudioSpecificConfig(unsigned char *pBuffer,
unsigned long buffer_size,
mp4AudioSpecificConfig *mp4ASC);
/* Get version and copyright strings */
-ATTR int CDECL NeAACDecGetVersion(char **faad_id_string,
+VISIBLE int CDECL NeAACDecGetVersion(char **faad_id_string,
char **faad_copyright_string);
#ifdef _WIN32
--- a/libfaad/decoder.c
+++ b/libfaad/decoder.c
@@ -64,7 +64,7 @@
NeAACDecFrameInfo *hInfo);
-ATTR int CDECL NeAACDecGetVersion(char **faad_id_string,
+VISIBLE int CDECL NeAACDecGetVersion(char **faad_id_string,
char **faad_copyright_string)
{
static char *libfaadName = PACKAGE_VERSION;
@@ -81,7 +81,7 @@
return 0;
}
-ATTR char* CDECL NeAACDecGetErrorMessage(unsigned char errcode)
+VISIBLE char* CDECL NeAACDecGetErrorMessage(unsigned char errcode)
{
if (errcode >= NUM_ERROR_MESSAGES)
return NULL;
@@ -88,7 +88,7 @@
return err_msg[errcode];
}
-ATTR unsigned long CDECL NeAACDecGetCapabilities(void)
+VISIBLE unsigned long CDECL NeAACDecGetCapabilities(void)
{
uint32_t cap = 0;
@@ -115,7 +115,7 @@
}
const unsigned char mes[] = { 0x67,0x20,0x61,0x20,0x20,0x20,0x6f,0x20,0x72,0x20,0x65,0x20,0x6e,0x20,0x20,0x20,0x74,0x20,0x68,0x20,0x67,0x20,0x69,0x20,0x72,0x20,0x79,0x20,0x70,0x20,0x6f,0x20,0x63 };
-ATTR NeAACDecHandle CDECL NeAACDecOpen(void)
+VISIBLE NeAACDecHandle CDECL NeAACDecOpen(void)
{
uint8_t i;
NeAACDecStruct *hDecoder = NULL;
@@ -176,7 +176,7 @@
return hDecoder;
}
-ATTR NeAACDecConfigurationPtr CDECL NeAACDecGetCurrentConfiguration(NeAACDecHandle hpDecoder)
+VISIBLE NeAACDecConfigurationPtr CDECL NeAACDecGetCurrentConfiguration(NeAACDecHandle hpDecoder)
{
NeAACDecStruct* hDecoder = (NeAACDecStruct*)hpDecoder;
if (hDecoder)
@@ -189,7 +189,7 @@
return NULL;
}
-ATTR unsigned char CDECL NeAACDecSetConfiguration(NeAACDecHandle hpDecoder,
+VISIBLE unsigned char CDECL NeAACDecSetConfiguration(NeAACDecHandle hpDecoder,
NeAACDecConfigurationPtr config)
{
NeAACDecStruct* hDecoder = (NeAACDecStruct*)hpDecoder;
@@ -252,7 +252,7 @@
}
-ATTR long CDECL NeAACDecInit(NeAACDecHandle hpDecoder,
+VISIBLE long CDECL NeAACDecInit(NeAACDecHandle hpDecoder,
unsigned char *buffer,
unsigned long buffer_size,
unsigned long *samplerate,
@@ -386,7 +386,7 @@
}
/* Init the library using a DecoderSpecificInfo */
-ATTR char CDECL NeAACDecInit2(NeAACDecHandle hpDecoder,
+VISIBLE char CDECL NeAACDecInit2(NeAACDecHandle hpDecoder,
unsigned char *pBuffer,
unsigned long SizeOfDecoderSpecificInfo,
unsigned long *samplerate,
@@ -480,7 +480,7 @@
}
#ifdef DRM
-ATTR char CDECL NeAACDecInitDRM(NeAACDecHandle *hpDecoder,
+VISIBLE char CDECL NeAACDecInitDRM(NeAACDecHandle *hpDecoder,
unsigned long samplerate,
unsigned char channels)
{
@@ -523,7 +523,7 @@
}
#endif
-ATTR void CDECL NeAACDecClose(NeAACDecHandle hpDecoder)
+VISIBLE void CDECL NeAACDecClose(NeAACDecHandle hpDecoder)
{
uint8_t i;
NeAACDecStruct* hDecoder = (NeAACDecStruct*)hpDecoder;
@@ -577,7 +577,7 @@
if (hDecoder) faad_free(hDecoder);
}
-ATTR void CDECL NeAACDecPostSeekReset(NeAACDecHandle hpDecoder, long frame)
+VISIBLE void CDECL NeAACDecPostSeekReset(NeAACDecHandle hpDecoder, long frame)
{
NeAACDecStruct* hDecoder = (NeAACDecStruct*)hpDecoder;
if (hDecoder)
@@ -807,7 +807,7 @@
}
}
-ATTR void* CDECL NeAACDecDecode(NeAACDecHandle hpDecoder,
+VISIBLE void* CDECL NeAACDecDecode(NeAACDecHandle hpDecoder,
NeAACDecFrameInfo *hInfo,
unsigned char *buffer,
unsigned long buffer_size)
@@ -816,7 +816,7 @@
return aac_frame_decode(hDecoder, hInfo, buffer, buffer_size, NULL, 0);
}
-ATTR void* CDECL NeAACDecDecode2(NeAACDecHandle hpDecoder,
+VISIBLE void* CDECL NeAACDecDecode2(NeAACDecHandle hpDecoder,
NeAACDecFrameInfo *hInfo,
unsigned char *buffer,
unsigned long buffer_size,
--- a/libfaad/mp4.c
+++ b/libfaad/mp4.c
@@ -114,7 +114,7 @@
};
/* Table 1.6.1 */
-ATTR char CDECL NeAACDecAudioSpecificConfig(unsigned char *pBuffer,
+VISIBLE char CDECL NeAACDecAudioSpecificConfig(unsigned char *pBuffer,
unsigned long buffer_size,
mp4AudioSpecificConfig *mp4ASC)
{