Commit 1b878f34 authored by Ghislain MARY's avatar Ghislain MARY

Handle DLL export and import correctly.

parent 8938c8a9
......@@ -51,7 +51,7 @@
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugDLL|Win32'" />
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level4</WarningLevel>
......@@ -70,7 +70,11 @@
<WarningLevel>Level4</WarningLevel>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(ProjectDir)..\..\..\include;$(ProjectDir)..\..\..\src;$(ProjectDir)..\..\..\..\cunit\build\windows\cunit\$(ConfigurationName);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;BELLESIP_EXPORTS;BELLESIP_INTERNAL_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
<StringPooling>true</StringPooling>
<MinimalRebuild>false</MinimalRebuild>
<FloatingPointExceptions>true</FloatingPointExceptions>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
......
......@@ -54,6 +54,11 @@
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;BELLESIP_EXPORTS;BELLESIP_INTERNAL_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(ProjectDir)..\..\..\include;$(ProjectDir)..\..\..\..\antlr3\runtime\C\include;$(ProjectDir)..\..\..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessToFile>false</PreprocessToFile>
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
<StringPooling>true</StringPooling>
<MinimalRebuild>false</MinimalRebuild>
<FloatingPointExceptions>true</FloatingPointExceptions>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
......
......@@ -34,8 +34,10 @@
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32) || defined(__WIN32__)
#ifdef BELLESIP_EXPORTS
#define BELLESIP_EXPORT __declspec(dllexport)
#define BELLESIP_VAR_EXPORT __declspec(dllexport)
#else
#define BELLESIP_EXPORT extern
#define BELLESIP_EXPORT
#define BELLESIP_VAR_EXPORT extern __declspec(dllimport)
#endif
#else
#define BELLESIP_EXPORT extern
......
......@@ -41,7 +41,7 @@ typedef unsigned int belle_sip_type_id_t;
#define BELLE_SIP_DECLARE_VPTR(object_type) \
typedef belle_sip_object_vptr_t BELLE_SIP_OBJECT_VPTR_TYPE(object_type);\
extern BELLE_SIP_OBJECT_VPTR_TYPE(object_type) BELLE_SIP_OBJECT_VPTR_NAME(object_type);
BELLESIP_EXPORT BELLE_SIP_OBJECT_VPTR_TYPE(object_type) BELLE_SIP_OBJECT_VPTR_NAME(object_type);
#define BELLE_SIP_DECLARE_CUSTOM_VPTR_BEGIN(object_type, parent_type) \
typedef struct object_type##_vptr_struct BELLE_SIP_OBJECT_VPTR_TYPE(object_type);\
......@@ -128,8 +128,6 @@ struct _belle_sip_object_vptr{
typedef struct _belle_sip_object_vptr belle_sip_object_vptr_t;
BELLESIP_EXPORT belle_sip_object_vptr_t belle_sip_object_t_vptr;
struct _belle_sip_object{
belle_sip_object_vptr_t *vptr;
size_t size;
......@@ -141,6 +139,8 @@ struct _belle_sip_object{
BELLE_SIP_BEGIN_DECLS
BELLESIP_VAR_EXPORT belle_sip_object_vptr_t belle_sip_object_t_vptr;
BELLESIP_EXPORT belle_sip_object_t * _belle_sip_object_new(size_t objsize, belle_sip_object_vptr_t *vptr);
......
......@@ -55,7 +55,7 @@ typedef unsigned char uint8_t;
#ifdef BELLESIP_INTERNAL_EXPORTS
#define BELLESIP_INTERNAL_EXPORT __declspec(dllexport)
#else
#define BELLESIP_INTERNAL_EXPORT extern
#define BELLESIP_INTERNAL_EXPORT
#endif
#else
#define BELLESIP_INTERNAL_EXPORT extern
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment