dsp: add DSP_INIT_STUB

generates a stub function when the specific architecture is not enabled,
exposing a symbol in the module, avoiding a compiler warning

Change-Id: Ia9336e57466a9b5241b85c1c95838e91c9283147
This commit is contained in:
James Zern 2015-04-02 23:19:37 -07:00
parent 03e76e962e
commit b44eda3f60
36 changed files with 45 additions and 74 deletions

View File

@ -136,7 +136,6 @@ WEBP_TSAN_IGNORE_FUNCTION void WebPInitAlphaProcessingMIPSdspR2(void) {
#else // !WEBP_USE_MIPS_DSP_R2
extern void WebPInitAlphaProcessingMIPSdspR2(void);
WEBP_TSAN_IGNORE_FUNCTION void WebPInitAlphaProcessingMIPSdspR2(void) {}
WEBP_DSP_INIT_STUB(WebPInitAlphaProcessingMIPSdspR2)
#endif // WEBP_USE_MIPS_DSP_R2

View File

@ -293,7 +293,6 @@ WEBP_TSAN_IGNORE_FUNCTION void WebPInitAlphaProcessingSSE2(void) {
#else // !WEBP_USE_SSE2
extern void WebPInitAlphaProcessingSSE2(void);
WEBP_TSAN_IGNORE_FUNCTION void WebPInitAlphaProcessingSSE2(void) {}
WEBP_DSP_INIT_STUB(WebPInitAlphaProcessingSSE2)
#endif // WEBP_USE_SSE2

View File

@ -105,7 +105,6 @@ WEBP_TSAN_IGNORE_FUNCTION void VP8EncDspARGBInitMIPSdspR2(void) {
#else // !WEBP_USE_MIPS_DSP_R2
extern void VP8EncDspARGBInitMIPSdspR2(void);
WEBP_TSAN_IGNORE_FUNCTION void VP8EncDspARGBInitMIPSdspR2(void) {}
WEBP_DSP_INIT_STUB(VP8EncDspARGBInitMIPSdspR2)
#endif // WEBP_USE_MIPS_DSP_R2

View File

@ -62,7 +62,6 @@ WEBP_TSAN_IGNORE_FUNCTION void VP8EncDspARGBInitSSE2(void) {
#else // !WEBP_USE_SSE2
extern void VP8EncDspARGBInitSSE2(void);
WEBP_TSAN_IGNORE_FUNCTION void VP8EncDspARGBInitSSE2(void) {}
WEBP_DSP_INIT_STUB(VP8EncDspARGBInitSSE2)
#endif // WEBP_USE_SSE2

View File

@ -149,7 +149,6 @@ WEBP_TSAN_IGNORE_FUNCTION void VP8EncDspCostInitMIPS32(void) {
#else // !WEBP_USE_MIPS32
extern void VP8EncDspCostInitMIPS32(void);
WEBP_TSAN_IGNORE_FUNCTION void VP8EncDspCostInitMIPS32(void) {}
WEBP_DSP_INIT_STUB(VP8EncDspCostInitMIPS32)
#endif // WEBP_USE_MIPS32

View File

@ -102,7 +102,6 @@ WEBP_TSAN_IGNORE_FUNCTION void VP8EncDspCostInitMIPSdspR2(void) {
#else // !WEBP_USE_MIPS_DSP_R2
extern void VP8EncDspCostInitMIPSdspR2(void);
WEBP_TSAN_IGNORE_FUNCTION void VP8EncDspCostInitMIPSdspR2(void) {}
WEBP_DSP_INIT_STUB(VP8EncDspCostInitMIPSdspR2)
#endif // WEBP_USE_MIPS_DSP_R2

View File

@ -119,7 +119,6 @@ WEBP_TSAN_IGNORE_FUNCTION void VP8EncDspCostInitSSE2(void) {
#else // !WEBP_USE_SSE2
extern void VP8EncDspCostInitSSE2(void);
WEBP_TSAN_IGNORE_FUNCTION void VP8EncDspCostInitSSE2(void) {}
WEBP_DSP_INIT_STUB(VP8EncDspCostInitSSE2)
#endif // WEBP_USE_SSE2

View File

@ -582,7 +582,6 @@ WEBP_TSAN_IGNORE_FUNCTION void VP8DspInitMIPS32(void) {
#else // !WEBP_USE_MIPS32
extern void VP8DspInitMIPS32(void);
WEBP_TSAN_IGNORE_FUNCTION void VP8DspInitMIPS32(void) {}
WEBP_DSP_INIT_STUB(VP8DspInitMIPS32)
#endif // WEBP_USE_MIPS32

View File

@ -989,7 +989,6 @@ WEBP_TSAN_IGNORE_FUNCTION void VP8DspInitMIPSdspR2(void) {
#else // !WEBP_USE_MIPS_DSP_R2
extern void VP8DspInitMIPSdspR2(void);
WEBP_TSAN_IGNORE_FUNCTION void VP8DspInitMIPSdspR2(void) {}
WEBP_DSP_INIT_STUB(VP8DspInitMIPSdspR2)
#endif // WEBP_USE_MIPS_DSP_R2

View File

@ -1486,7 +1486,6 @@ WEBP_TSAN_IGNORE_FUNCTION void VP8DspInitNEON(void) {
#else // !WEBP_USE_NEON
extern void VP8DspInitNEON(void);
WEBP_TSAN_IGNORE_FUNCTION void VP8DspInitNEON(void) {}
WEBP_DSP_INIT_STUB(VP8DspInitNEON)
#endif // WEBP_USE_NEON

View File

@ -1280,7 +1280,6 @@ WEBP_TSAN_IGNORE_FUNCTION void VP8DspInitSSE2(void) {
#else // !WEBP_USE_SSE2
extern void VP8DspInitSSE2(void);
WEBP_TSAN_IGNORE_FUNCTION void VP8DspInitSSE2(void) {}
WEBP_DSP_INIT_STUB(VP8DspInitSSE2)
#endif // WEBP_USE_SSE2

View File

@ -40,7 +40,6 @@ WEBP_TSAN_IGNORE_FUNCTION void VP8DspInitSSE41(void) {
#else // !WEBP_USE_SSE41
extern void VP8DspInitSSE41(void);
WEBP_TSAN_IGNORE_FUNCTION void VP8DspInitSSE41(void) {}
WEBP_DSP_INIT_STUB(VP8DspInitSSE41)
#endif // WEBP_USE_SSE41

View File

@ -122,6 +122,15 @@ typedef enum {
typedef int (*VP8CPUInfo)(CPUFeature feature);
WEBP_EXTERN(VP8CPUInfo) VP8GetCPUInfo;
//------------------------------------------------------------------------------
// Init stub generator
// Defines an init function stub to ensure each module exposes a symbol,
// avoiding a compiler warning.
#define WEBP_DSP_INIT_STUB(func) \
extern void func(void); \
WEBP_TSAN_IGNORE_FUNCTION void func(void) {}
//------------------------------------------------------------------------------
// Encoding

View File

@ -18,7 +18,4 @@
//------------------------------------------------------------------------------
// Entry point
extern void VP8EncDspInitAVX2(void);
WEBP_TSAN_IGNORE_FUNCTION void VP8EncDspInitAVX2(void) {
}
WEBP_DSP_INIT_STUB(VP8EncDspInitAVX2)

View File

@ -667,7 +667,6 @@ WEBP_TSAN_IGNORE_FUNCTION void VP8EncDspInitMIPS32(void) {
#else // !WEBP_USE_MIPS32
extern void VP8EncDspInitMIPS32(void);
WEBP_TSAN_IGNORE_FUNCTION void VP8EncDspInitMIPS32(void) {}
WEBP_DSP_INIT_STUB(VP8EncDspInitMIPS32)
#endif // WEBP_USE_MIPS32

View File

@ -1507,7 +1507,6 @@ WEBP_TSAN_IGNORE_FUNCTION void VP8EncDspInitMIPSdspR2(void) {
#else // !WEBP_USE_MIPS_DSP_R2
extern void VP8EncDspInitMIPSdspR2(void);
WEBP_TSAN_IGNORE_FUNCTION void VP8EncDspInitMIPSdspR2(void) {}
WEBP_DSP_INIT_STUB(VP8EncDspInitMIPSdspR2)
#endif // WEBP_USE_MIPS_DSP_R2

View File

@ -929,7 +929,6 @@ WEBP_TSAN_IGNORE_FUNCTION void VP8EncDspInitNEON(void) {
#else // !WEBP_USE_NEON
extern void VP8EncDspInitNEON(void);
WEBP_TSAN_IGNORE_FUNCTION void VP8EncDspInitNEON(void) {}
WEBP_DSP_INIT_STUB(VP8EncDspInitNEON)
#endif // WEBP_USE_NEON

View File

@ -937,7 +937,6 @@ WEBP_TSAN_IGNORE_FUNCTION void VP8EncDspInitSSE2(void) {
#else // !WEBP_USE_SSE2
extern void VP8EncDspInitSSE2(void);
WEBP_TSAN_IGNORE_FUNCTION void VP8EncDspInitSSE2(void) {}
WEBP_DSP_INIT_STUB(VP8EncDspInitSSE2)
#endif // WEBP_USE_SSE2

View File

@ -420,7 +420,6 @@ WEBP_TSAN_IGNORE_FUNCTION void VP8EncDspInitSSE41(void) {
#else // !WEBP_USE_SSE41
extern void VP8EncDspInitSSE41(void);
WEBP_TSAN_IGNORE_FUNCTION void VP8EncDspInitSSE41(void) {}
WEBP_DSP_INIT_STUB(VP8EncDspInitSSE41)
#endif // WEBP_USE_SSE41

View File

@ -400,7 +400,6 @@ WEBP_TSAN_IGNORE_FUNCTION void VP8FiltersInitMIPSdspR2(void) {
#else // !WEBP_USE_MIPS_DSP_R2
extern void VP8FiltersInitMIPSdspR2(void);
WEBP_TSAN_IGNORE_FUNCTION void VP8FiltersInitMIPSdspR2(void) {}
WEBP_DSP_INIT_STUB(VP8FiltersInitMIPSdspR2)
#endif // WEBP_USE_MIPS_DSP_R2

View File

@ -347,7 +347,6 @@ WEBP_TSAN_IGNORE_FUNCTION void VP8FiltersInitSSE2(void) {
#else // !WEBP_USE_SSE2
extern void VP8FiltersInitSSE2(void);
WEBP_TSAN_IGNORE_FUNCTION void VP8FiltersInitSSE2(void) {}
WEBP_DSP_INIT_STUB(VP8FiltersInitSSE2)
#endif // WEBP_USE_SSE2

View File

@ -413,7 +413,6 @@ WEBP_TSAN_IGNORE_FUNCTION void VP8LEncDspInitMIPS32(void) {
#else // !WEBP_USE_MIPS32
extern void VP8LEncDspInitMIPS32(void);
WEBP_TSAN_IGNORE_FUNCTION void VP8LEncDspInitMIPS32(void) {}
WEBP_DSP_INIT_STUB(VP8LEncDspInitMIPS32)
#endif // WEBP_USE_MIPS32

View File

@ -270,7 +270,6 @@ WEBP_TSAN_IGNORE_FUNCTION void VP8LEncDspInitMIPSdspR2(void) {
#else // !WEBP_USE_MIPS_DSP_R2
extern void VP8LEncDspInitMIPSdspR2(void);
WEBP_TSAN_IGNORE_FUNCTION void VP8LEncDspInitMIPSdspR2(void) {}
WEBP_DSP_INIT_STUB(VP8LEncDspInitMIPSdspR2)
#endif // WEBP_USE_MIPS_DSP_R2

View File

@ -87,7 +87,6 @@ WEBP_TSAN_IGNORE_FUNCTION void VP8LEncDspInitNEON(void) {
#else // !WEBP_USE_NEON
extern void VP8LEncDspInitNEON(void);
WEBP_TSAN_IGNORE_FUNCTION void VP8LEncDspInitNEON(void) {}
WEBP_DSP_INIT_STUB(VP8LEncDspInitNEON)
#endif // WEBP_USE_NEON

View File

@ -188,7 +188,6 @@ WEBP_TSAN_IGNORE_FUNCTION void VP8LEncDspInitSSE2(void) {
#else // !WEBP_USE_SSE2
extern void VP8LEncDspInitSSE2(void);
WEBP_TSAN_IGNORE_FUNCTION void VP8LEncDspInitSSE2(void) {}
WEBP_DSP_INIT_STUB(VP8LEncDspInitSSE2)
#endif // WEBP_USE_SSE2

View File

@ -675,7 +675,6 @@ WEBP_TSAN_IGNORE_FUNCTION void VP8LDspInitMIPSdspR2(void) {
#else // !WEBP_USE_MIPS_DSP_R2
extern void VP8LDspInitMIPSdspR2(void);
WEBP_TSAN_IGNORE_FUNCTION void VP8LDspInitMIPSdspR2(void) {}
WEBP_DSP_INIT_STUB(VP8LDspInitMIPSdspR2)
#endif // WEBP_USE_MIPS_DSP_R2

View File

@ -335,7 +335,6 @@ WEBP_TSAN_IGNORE_FUNCTION void VP8LDspInitNEON(void) {
#else // !WEBP_USE_NEON
extern void VP8LDspInitNEON(void);
WEBP_TSAN_IGNORE_FUNCTION void VP8LDspInitNEON(void) {}
WEBP_DSP_INIT_STUB(VP8LDspInitNEON)
#endif // WEBP_USE_NEON

View File

@ -388,7 +388,6 @@ WEBP_TSAN_IGNORE_FUNCTION void VP8LDspInitSSE2(void) {
#else // !WEBP_USE_SSE2
extern void VP8LDspInitSSE2(void);
WEBP_TSAN_IGNORE_FUNCTION void VP8LDspInitSSE2(void) {}
WEBP_DSP_INIT_STUB(VP8LDspInitSSE2)
#endif // WEBP_USE_SSE2

View File

@ -189,7 +189,6 @@ WEBP_TSAN_IGNORE_FUNCTION void WebPRescalerDspInitMIPS32(void) {
#else // !WEBP_USE_MIPS32
extern void WebPRescalerDspInitMIPS32(void);
WEBP_TSAN_IGNORE_FUNCTION void WebPRescalerDspInitMIPS32(void) {}
WEBP_DSP_INIT_STUB(WebPRescalerDspInitMIPS32)
#endif // WEBP_USE_MIPS32

View File

@ -207,7 +207,6 @@ WEBP_TSAN_IGNORE_FUNCTION void WebPRescalerDspInitMIPSdspR2(void) {
#else // !WEBP_USE_MIPS_DSP_R2
extern void WebPRescalerDspInitMIPSdspR2(void);
WEBP_TSAN_IGNORE_FUNCTION void WebPRescalerDspInitMIPSdspR2(void) {}
WEBP_DSP_INIT_STUB(WebPRescalerDspInitMIPSdspR2)
#endif // WEBP_USE_MIPS_DSP_R2

View File

@ -273,12 +273,10 @@ WEBP_TSAN_IGNORE_FUNCTION void WebPInitYUV444ConvertersMIPSdspR2(void) {
#else // !WEBP_USE_MIPS_DSP_R2
extern void WebPInitYUV444ConvertersMIPSdspR2(void);
WEBP_TSAN_IGNORE_FUNCTION void WebPInitYUV444ConvertersMIPSdspR2(void) {}
WEBP_DSP_INIT_STUB(WebPInitYUV444ConvertersMIPSdspR2)
#endif // WEBP_USE_MIPS_DSP_R2
#if !(defined(FANCY_UPSAMPLING) && defined(WEBP_USE_MIPS_DSP_R2))
extern void WebPInitUpsamplersMIPSdspR2(void);
WEBP_TSAN_IGNORE_FUNCTION void WebPInitUpsamplersMIPSdspR2(void) {}
WEBP_DSP_INIT_STUB(WebPInitUpsamplersMIPSdspR2)
#endif

View File

@ -257,6 +257,5 @@ WEBP_TSAN_IGNORE_FUNCTION void WebPInitUpsamplersNEON(void) {
#endif // WEBP_USE_NEON
#if !(defined(FANCY_UPSAMPLING) && defined(WEBP_USE_NEON))
extern void WebPInitUpsamplersNEON(void);
WEBP_TSAN_IGNORE_FUNCTION void WebPInitUpsamplersNEON(void) {}
WEBP_DSP_INIT_STUB(WebPInitUpsamplersNEON)
#endif

View File

@ -204,6 +204,5 @@ WEBP_TSAN_IGNORE_FUNCTION void WebPInitUpsamplersSSE2(void) {
#endif // WEBP_USE_SSE2
#if !(defined(FANCY_UPSAMPLING) && defined(WEBP_USE_SSE2))
extern void WebPInitUpsamplersSSE2(void);
WEBP_TSAN_IGNORE_FUNCTION void WebPInitUpsamplersSSE2(void) {}
WEBP_DSP_INIT_STUB(WebPInitUpsamplersSSE2)
#endif

View File

@ -98,7 +98,6 @@ WEBP_TSAN_IGNORE_FUNCTION void WebPInitSamplersMIPS32(void) {
#else // !WEBP_USE_MIPS32
extern void WebPInitSamplersMIPS32(void);
WEBP_TSAN_IGNORE_FUNCTION void WebPInitSamplersMIPS32(void) {}
WEBP_DSP_INIT_STUB(WebPInitSamplersMIPS32)
#endif // WEBP_USE_MIPS32

View File

@ -129,7 +129,6 @@ WEBP_TSAN_IGNORE_FUNCTION void WebPInitSamplersMIPSdspR2(void) {
#else // !WEBP_USE_MIPS_DSP_R2
extern void WebPInitSamplersMIPSdspR2(void);
WEBP_TSAN_IGNORE_FUNCTION void WebPInitSamplersMIPSdspR2(void) {}
WEBP_DSP_INIT_STUB(WebPInitSamplersMIPSdspR2)
#endif // WEBP_USE_MIPS_DSP_R2

View File

@ -319,7 +319,6 @@ WEBP_TSAN_IGNORE_FUNCTION void WebPInitSamplersSSE2(void) {
#else // !WEBP_USE_SSE2
extern void WebPInitSamplersSSE2(void);
WEBP_TSAN_IGNORE_FUNCTION void WebPInitSamplersSSE2(void) {}
WEBP_DSP_INIT_STUB(WebPInitSamplersSSE2)
#endif // WEBP_USE_SSE2