mirror of
https://github.com/beefytech/Beef.git
synced 2025-07-04 23:36:00 +02:00
Interop fixes and tests, fixing xplat struct passing issues
This commit is contained in:
parent
4cf6af53bd
commit
5da74382d4
31 changed files with 1569 additions and 239 deletions
31
IDEHelper/Tests/CLib/CLib.sln
Normal file
31
IDEHelper/Tests/CLib/CLib.sln
Normal file
|
@ -0,0 +1,31 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 15
|
||||
VisualStudioVersion = 15.0.28307.645
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CLib", "CLib.vcxproj", "{D72A956A-5D9C-42F4-B35B-05F0B05B632C}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|x64 = Debug|x64
|
||||
Debug|x86 = Debug|x86
|
||||
Release|x64 = Release|x64
|
||||
Release|x86 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{D72A956A-5D9C-42F4-B35B-05F0B05B632C}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{D72A956A-5D9C-42F4-B35B-05F0B05B632C}.Debug|x64.Build.0 = Debug|x64
|
||||
{D72A956A-5D9C-42F4-B35B-05F0B05B632C}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{D72A956A-5D9C-42F4-B35B-05F0B05B632C}.Debug|x86.Build.0 = Debug|Win32
|
||||
{D72A956A-5D9C-42F4-B35B-05F0B05B632C}.Release|x64.ActiveCfg = Release|x64
|
||||
{D72A956A-5D9C-42F4-B35B-05F0B05B632C}.Release|x64.Build.0 = Release|x64
|
||||
{D72A956A-5D9C-42F4-B35B-05F0B05B632C}.Release|x86.ActiveCfg = Release|Win32
|
||||
{D72A956A-5D9C-42F4-B35B-05F0B05B632C}.Release|x86.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {B4D3315D-D9A9-4A82-BEC4-B05271FC794E}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
162
IDEHelper/Tests/CLib/CLib.vcxproj
Normal file
162
IDEHelper/Tests/CLib/CLib.vcxproj
Normal file
|
@ -0,0 +1,162 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>15.0</VCProjectVersion>
|
||||
<ProjectGuid>{D72A956A-5D9C-42F4-B35B-05F0B05B632C}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>CLib</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>10.0.18362.0</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="Shared">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<BufferSecurityCheck>false</BufferSecurityCheck>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="stdafx.h" />
|
||||
<ClInclude Include="targetver.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="main.cpp" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
30
IDEHelper/Tests/CLib/CLib.vcxproj.filters
Normal file
30
IDEHelper/Tests/CLib/CLib.vcxproj.filters
Normal file
|
@ -0,0 +1,30 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hh;hpp;hxx;hm;inl;inc;ipp;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Resource Files">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="stdafx.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="targetver.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="main.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
371
IDEHelper/Tests/CLib/main.cpp
Normal file
371
IDEHelper/Tests/CLib/main.cpp
Normal file
|
@ -0,0 +1,371 @@
|
|||
#include <inttypes.h>
|
||||
|
||||
namespace Tests
|
||||
{
|
||||
struct Interop
|
||||
{
|
||||
struct StructA
|
||||
{
|
||||
int mA;
|
||||
|
||||
int MethodA0(int arg0)
|
||||
{
|
||||
return arg0 + mA * 100;
|
||||
}
|
||||
|
||||
StructA MethodA1(StructA other, int arg0)
|
||||
{
|
||||
StructA ret;
|
||||
ret.mA = mA + other.mA + arg0;
|
||||
return ret;
|
||||
}
|
||||
};
|
||||
|
||||
struct StructB
|
||||
{
|
||||
int mA;
|
||||
char mB;
|
||||
|
||||
int MethodB0(int arg0)
|
||||
{
|
||||
return arg0 + mA * 100 + mB * 10000;
|
||||
}
|
||||
|
||||
StructB MethodB1(StructB other, int arg0)
|
||||
{
|
||||
StructB ret;
|
||||
ret.mA = mA + other.mA + arg0;
|
||||
ret.mB = mB + other.mB;
|
||||
return ret;
|
||||
}
|
||||
};
|
||||
|
||||
struct StructC
|
||||
{
|
||||
char mA;
|
||||
int mB;
|
||||
|
||||
int MethodC0(int arg0)
|
||||
{
|
||||
return arg0 + mA * 100 + mB * 10000;
|
||||
}
|
||||
|
||||
StructC MethodC1(StructC other, int arg0)
|
||||
{
|
||||
StructC ret;
|
||||
ret.mA = mA + other.mA + arg0;
|
||||
ret.mB = mB + other.mB;
|
||||
return ret;
|
||||
}
|
||||
};
|
||||
|
||||
struct StructD
|
||||
{
|
||||
int mA;
|
||||
int mB;
|
||||
|
||||
int MethodD0(int arg0)
|
||||
{
|
||||
return arg0 + mA * 100 + mB * 10000;
|
||||
}
|
||||
|
||||
StructD MethodD1(StructD other, int arg0)
|
||||
{
|
||||
StructD ret;
|
||||
ret.mA = mA + other.mA + arg0;
|
||||
ret.mB = mB + other.mB;
|
||||
return ret;
|
||||
}
|
||||
};
|
||||
|
||||
struct StructE
|
||||
{
|
||||
int mA;
|
||||
int mB;
|
||||
int mC;
|
||||
|
||||
int MethodE0(int arg0)
|
||||
{
|
||||
return arg0 + mA * 100 + mC * 10000;
|
||||
}
|
||||
|
||||
StructE MethodE1(StructE other, int arg0)
|
||||
{
|
||||
StructE ret;
|
||||
ret.mA = mA + other.mA + arg0;
|
||||
ret.mB = mB + other.mB;
|
||||
return ret;
|
||||
}
|
||||
};
|
||||
|
||||
struct StructF
|
||||
{
|
||||
char mA;
|
||||
char mB;
|
||||
char mC;
|
||||
|
||||
int MethodF0(int arg0)
|
||||
{
|
||||
return arg0 + mA * 100 + mC * 10000;
|
||||
}
|
||||
|
||||
StructF MethodF1(StructF other, int arg0)
|
||||
{
|
||||
StructF ret;
|
||||
ret.mA = mA + other.mA + arg0;
|
||||
ret.mB = mB + other.mB;
|
||||
return ret;
|
||||
}
|
||||
};
|
||||
|
||||
struct StructG
|
||||
{
|
||||
char mA;
|
||||
char mB;
|
||||
char mC;
|
||||
char mD;
|
||||
|
||||
int MethodG0(int arg0)
|
||||
{
|
||||
return arg0 + mA * 100 + mC * 10000;
|
||||
}
|
||||
|
||||
StructG MethodG1(StructG other, int arg0)
|
||||
{
|
||||
StructG ret;
|
||||
ret.mA = mA + other.mA + arg0;
|
||||
ret.mB = mB + other.mB;
|
||||
return ret;
|
||||
}
|
||||
};
|
||||
|
||||
struct StructH
|
||||
{
|
||||
int64_t mA;
|
||||
int64_t mB;
|
||||
int64_t mC;
|
||||
|
||||
int MethodH0(int arg0)
|
||||
{
|
||||
return arg0 + (int)mA * 100 + (int)mC * 10000;
|
||||
}
|
||||
|
||||
StructH MethodH1(StructH other, int arg0)
|
||||
{
|
||||
StructH ret;
|
||||
ret.mA = mA + other.mA + arg0;
|
||||
ret.mB = mB + other.mB;
|
||||
return ret;
|
||||
}
|
||||
};
|
||||
|
||||
struct StructI
|
||||
{
|
||||
char mA;
|
||||
char mB;
|
||||
char mC;
|
||||
char mD;
|
||||
char mE;
|
||||
|
||||
int MethodI0(int arg0)
|
||||
{
|
||||
return arg0 + (int)mA * 100 + (int)mC * 10000;
|
||||
}
|
||||
|
||||
StructI MethodI1(StructI other, int arg0)
|
||||
{
|
||||
StructI ret;
|
||||
ret.mA = mA + other.mA + arg0;
|
||||
ret.mB = mB + other.mB;
|
||||
return ret;
|
||||
}
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
using namespace Tests;
|
||||
|
||||
extern "C" int Func0(int a, int b)
|
||||
{
|
||||
return a + b * 100;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
extern "C" int Func1A(Interop::StructA arg0, Interop::StructA arg1, int arg2)
|
||||
{
|
||||
return arg0.mA + arg1.mA * 100 + arg2 * 10000;
|
||||
}
|
||||
|
||||
extern "C" int Func1B(Interop::StructB arg0, Interop::StructB arg1, int arg2)
|
||||
{
|
||||
return arg0.mA + arg1.mA * 100 + arg2 * 10000;
|
||||
}
|
||||
|
||||
extern "C" int Func1C(Interop::StructC arg0, Interop::StructC arg1, int arg2)
|
||||
{
|
||||
return arg0.mA + arg1.mA * 100 + arg2 * 10000;
|
||||
}
|
||||
|
||||
extern "C" int Func1D(Interop::StructD arg0, Interop::StructD arg1, int arg2)
|
||||
{
|
||||
return arg0.mA + arg1.mA * 100 + arg2 * 10000;
|
||||
}
|
||||
|
||||
extern "C" int Func1E(Interop::StructE arg0, Interop::StructE arg1, int arg2)
|
||||
{
|
||||
return arg0.mA + arg1.mA * 100 + arg2 * 10000;
|
||||
}
|
||||
|
||||
extern "C" int Func1F(Interop::StructF arg0, Interop::StructF arg1, int arg2)
|
||||
{
|
||||
return arg0.mA + arg1.mA * 100 + arg2 * 10000;
|
||||
}
|
||||
|
||||
extern "C" int Func1G(Interop::StructG arg0, Interop::StructG arg1, int arg2)
|
||||
{
|
||||
return arg0.mA + arg1.mA * 100 + arg2 * 10000;
|
||||
}
|
||||
|
||||
extern "C" int Func1H(Interop::StructH arg0, Interop::StructH arg1, int arg2)
|
||||
{
|
||||
return (int)arg0.mA + (int)arg1.mA * 100 + arg2 * 10000;
|
||||
}
|
||||
|
||||
extern "C" int Func1I(Interop::StructI arg0, Interop::StructI arg1, int arg2)
|
||||
{
|
||||
return (int)arg0.mA + (int)arg1.mA * 100 + arg2 * 10000;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
extern "C" Interop::StructA Func2A(Interop::StructA arg0, int arg1)
|
||||
{
|
||||
Interop::StructA ret;
|
||||
ret.mA = arg0.mA + arg1;
|
||||
return ret;
|
||||
}
|
||||
|
||||
extern "C" Interop::StructB Func2B(Interop::StructB arg0, int arg1)
|
||||
{
|
||||
Interop::StructB ret;
|
||||
ret.mA = arg0.mA + arg1;
|
||||
return ret;
|
||||
}
|
||||
|
||||
extern "C" Interop::StructC Func2C(Interop::StructC arg0, int arg1)
|
||||
{
|
||||
Interop::StructC ret;
|
||||
ret.mA = arg0.mA + arg1;
|
||||
return ret;
|
||||
}
|
||||
|
||||
extern "C" Interop::StructD Func2D(Interop::StructD arg0, int arg1)
|
||||
{
|
||||
Interop::StructD ret;
|
||||
ret.mA = arg0.mA + arg1;
|
||||
return ret;
|
||||
}
|
||||
|
||||
extern "C" Interop::StructE Func2E(Interop::StructE arg0, int arg1)
|
||||
{
|
||||
Interop::StructE ret;
|
||||
ret.mA = arg0.mA + arg1;
|
||||
return ret;
|
||||
}
|
||||
|
||||
extern "C" Interop::StructF Func2F(Interop::StructF arg0, int arg1)
|
||||
{
|
||||
Interop::StructF ret;
|
||||
ret.mA = arg0.mA + arg1;
|
||||
return ret;
|
||||
}
|
||||
|
||||
extern "C" Interop::StructG Func2G(Interop::StructG arg0, int arg1)
|
||||
{
|
||||
Interop::StructG ret;
|
||||
ret.mA = arg0.mA + arg1;
|
||||
return ret;
|
||||
}
|
||||
|
||||
extern "C" Interop::StructH Func2H(Interop::StructH arg0, int arg1)
|
||||
{
|
||||
Interop::StructH ret;
|
||||
ret.mA = arg0.mA + arg1;
|
||||
return ret;
|
||||
}
|
||||
|
||||
extern "C" Interop::StructI Func2I(Interop::StructI arg0, int arg1)
|
||||
{
|
||||
Interop::StructI ret;
|
||||
ret.mA = arg0.mA + arg1;
|
||||
return ret;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
extern "C" int Func3A(Interop::StructA* ptr)
|
||||
{
|
||||
return ptr[0].mA + ptr[1].mA * 100;
|
||||
}
|
||||
|
||||
extern "C" int Func3B(Interop::StructB* ptr)
|
||||
{
|
||||
return ptr[0].mA + ptr[1].mA * 100;
|
||||
}
|
||||
|
||||
extern "C" int Func3C(Interop::StructC* ptr)
|
||||
{
|
||||
return ptr[0].mA + ptr[1].mA * 100;
|
||||
}
|
||||
|
||||
extern "C" int Func3D(Interop::StructD* ptr)
|
||||
{
|
||||
return ptr[0].mA + ptr[1].mA * 100;
|
||||
}
|
||||
|
||||
extern "C" int Func3E(Interop::StructE* ptr)
|
||||
{
|
||||
return ptr[0].mA + ptr[1].mA * 100;
|
||||
}
|
||||
|
||||
extern "C" int Func3F(Interop::StructF* ptr)
|
||||
{
|
||||
return ptr[0].mA + ptr[1].mA * 100;
|
||||
}
|
||||
|
||||
extern "C" int Func3G(Interop::StructG* ptr)
|
||||
{
|
||||
return ptr[0].mA + ptr[1].mA * 100;
|
||||
}
|
||||
|
||||
void UseIt()
|
||||
{
|
||||
Interop::StructA sa;
|
||||
sa.MethodA0(0);
|
||||
sa.MethodA1(sa, 1);
|
||||
Interop::StructB sb;
|
||||
sb.MethodB0(0);
|
||||
sb.MethodB1(sb, 1);
|
||||
Interop::StructC sc;
|
||||
sc.MethodC0(0);
|
||||
sc.MethodC1(sc, 1);
|
||||
Interop::StructD sd;
|
||||
sd.MethodD0(0);
|
||||
sd.MethodD1(sd, 1);
|
||||
Interop::StructE se;
|
||||
se.MethodE0(0);
|
||||
se.MethodE1(se, 1);
|
||||
Interop::StructF sf;
|
||||
sf.MethodF0(0);
|
||||
sf.MethodF1(sf, 1);
|
||||
Interop::StructG sg;
|
||||
sg.MethodG0(0);
|
||||
sg.MethodG1(sg, 1);
|
||||
Interop::StructH sh;
|
||||
sh.MethodH0(0);
|
||||
sh.MethodH1(sh, 1);
|
||||
Interop::StructI si;
|
||||
si.MethodI0(0);
|
||||
si.MethodI1(si, 1);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue