I'm dealing with someone else's code. From the docs, I see that the header may be all that is need to explain why I get 4
Severity Code Description Project File Line Suppression State
Warning C4273 'DTAIAEC_<Init/Run/Shutdown/Push>': inconsistent dll linkage
Two definitions in a file differ in their use of dllimport. _WIN32 is "always true". I guess that __declspec
conflicts with extern "C"
My question is how to solve it with:
#pragma once
#ifdef _WIN32
#ifdef DTAI_AEC_EXPORTS
#define DTAI_AEC_API __declspec(dllexport)
#else
#define DTAI_AEC_API __declspec(dllimport)
#endif
#else
#define DTAI_AEC_API
#endif
#include <vector>
#pragma pack(push, 1)
typedef struct {
}DTAIAEC_Multi_SoundBuffer;
typedef struct {
}DTAIAEC_Output_SoundBuffer;
#pragma pack(pop)
typedef int(*DTAIAEC_SoundBuffer_Output_CB_t) (DTAIAEC_Output_SoundBuffer*);
extern "C" DTAI_AEC_API int DTAIAEC_Init(DTAIAEC_SoundBuffer_Output_CB_t SoundBuffer_Res_Callback, int internalChannels);
extern "C" DTAI_AEC_API int DTAIAEC_Run(void);
extern "C" DTAI_AEC_API int DTAIAEC_Shutdown(void);
extern "C" DTAI_AEC_API int DTAIAEC_Push(DTAIAEC_Multi_SoundBuffer*);