Skip to content

Commit 8bc8cd9

Browse files
nthuemmeldstebila
authored andcommitted
Added VisualStudio DLL build configurations (open-quantum-safe#182)
* Added VisualStudio DLL build configurations Add inline preprocessor definition to VisualStudio project file - this allows compilation with older versions of VisualStudio (e.g. 2013) which do not support the C99 inline keyword Removed newhope.c from VisualStudio build files, as it is already included in kex_rlwe_newhope.c and will lead to multiple symbol definition errors in shared library builds Add ENABLE_CODE_MCBITS guard to kex_code_mcbits.c to protect against missing symbol definition errors in VisualStudio shared library builds Added VisualStudio shared library exports file dll.def, including the necessary core functions to use oqs from applications Also export free when building Windows DLLs - this is important as the correct runtime library has to be used to free memory allocated by the OQS library. Applications may be using multiple runtime libraries or memory managers, calling the wrong free will result in memory corruption or segfault * Add missing newline at end of file.
1 parent fc522d6 commit 8bc8cd9

File tree

8 files changed

+753
-8
lines changed

8 files changed

+753
-8
lines changed

VisualStudio/liboqs.sln

+36
Original file line numberDiff line numberDiff line change
@@ -24,42 +24,78 @@ Global
2424
GlobalSection(SolutionConfigurationPlatforms) = preSolution
2525
Debug|x64 = Debug|x64
2626
Debug|x86 = Debug|x86
27+
DebugDLL|x64 = DebugDLL|x64
28+
DebugDLL|x86 = DebugDLL|x86
2729
Release|x64 = Release|x64
2830
Release|x86 = Release|x86
31+
ReleaseDLL|x64 = ReleaseDLL|x64
32+
ReleaseDLL|x86 = ReleaseDLL|x86
2933
EndGlobalSection
3034
GlobalSection(ProjectConfigurationPlatforms) = postSolution
3135
{6BB96591-0BCD-42E6-8863-4B9BFE75530C}.Debug|x64.ActiveCfg = Debug|x64
3236
{6BB96591-0BCD-42E6-8863-4B9BFE75530C}.Debug|x64.Build.0 = Debug|x64
3337
{6BB96591-0BCD-42E6-8863-4B9BFE75530C}.Debug|x86.ActiveCfg = Debug|Win32
3438
{6BB96591-0BCD-42E6-8863-4B9BFE75530C}.Debug|x86.Build.0 = Debug|Win32
39+
{6BB96591-0BCD-42E6-8863-4B9BFE75530C}.DebugDLL|x64.ActiveCfg = DebugDLL|x64
40+
{6BB96591-0BCD-42E6-8863-4B9BFE75530C}.DebugDLL|x64.Build.0 = DebugDLL|x64
41+
{6BB96591-0BCD-42E6-8863-4B9BFE75530C}.DebugDLL|x86.ActiveCfg = DebugDLL|Win32
42+
{6BB96591-0BCD-42E6-8863-4B9BFE75530C}.DebugDLL|x86.Build.0 = DebugDLL|Win32
3543
{6BB96591-0BCD-42E6-8863-4B9BFE75530C}.Release|x64.ActiveCfg = Release|x64
3644
{6BB96591-0BCD-42E6-8863-4B9BFE75530C}.Release|x64.Build.0 = Release|x64
3745
{6BB96591-0BCD-42E6-8863-4B9BFE75530C}.Release|x86.ActiveCfg = Release|Win32
3846
{6BB96591-0BCD-42E6-8863-4B9BFE75530C}.Release|x86.Build.0 = Release|Win32
47+
{6BB96591-0BCD-42E6-8863-4B9BFE75530C}.ReleaseDLL|x64.ActiveCfg = ReleaseDLL|x64
48+
{6BB96591-0BCD-42E6-8863-4B9BFE75530C}.ReleaseDLL|x64.Build.0 = ReleaseDLL|x64
49+
{6BB96591-0BCD-42E6-8863-4B9BFE75530C}.ReleaseDLL|x86.ActiveCfg = ReleaseDLL|Win32
50+
{6BB96591-0BCD-42E6-8863-4B9BFE75530C}.ReleaseDLL|x86.Build.0 = ReleaseDLL|Win32
3951
{DCFEFB81-4696-45D2-9FCA-351CCFC13C74}.Debug|x64.ActiveCfg = Debug|x64
4052
{DCFEFB81-4696-45D2-9FCA-351CCFC13C74}.Debug|x64.Build.0 = Debug|x64
4153
{DCFEFB81-4696-45D2-9FCA-351CCFC13C74}.Debug|x86.ActiveCfg = Debug|Win32
4254
{DCFEFB81-4696-45D2-9FCA-351CCFC13C74}.Debug|x86.Build.0 = Debug|Win32
55+
{DCFEFB81-4696-45D2-9FCA-351CCFC13C74}.DebugDLL|x64.ActiveCfg = DebugDLL|x64
56+
{DCFEFB81-4696-45D2-9FCA-351CCFC13C74}.DebugDLL|x64.Build.0 = DebugDLL|x64
57+
{DCFEFB81-4696-45D2-9FCA-351CCFC13C74}.DebugDLL|x86.ActiveCfg = DebugDLL|Win32
58+
{DCFEFB81-4696-45D2-9FCA-351CCFC13C74}.DebugDLL|x86.Build.0 = DebugDLL|Win32
4359
{DCFEFB81-4696-45D2-9FCA-351CCFC13C74}.Release|x64.ActiveCfg = Release|x64
4460
{DCFEFB81-4696-45D2-9FCA-351CCFC13C74}.Release|x64.Build.0 = Release|x64
4561
{DCFEFB81-4696-45D2-9FCA-351CCFC13C74}.Release|x86.ActiveCfg = Release|Win32
4662
{DCFEFB81-4696-45D2-9FCA-351CCFC13C74}.Release|x86.Build.0 = Release|Win32
63+
{DCFEFB81-4696-45D2-9FCA-351CCFC13C74}.ReleaseDLL|x64.ActiveCfg = ReleaseDLL|x64
64+
{DCFEFB81-4696-45D2-9FCA-351CCFC13C74}.ReleaseDLL|x64.Build.0 = ReleaseDLL|x64
65+
{DCFEFB81-4696-45D2-9FCA-351CCFC13C74}.ReleaseDLL|x86.ActiveCfg = ReleaseDLL|Win32
66+
{DCFEFB81-4696-45D2-9FCA-351CCFC13C74}.ReleaseDLL|x86.Build.0 = ReleaseDLL|Win32
4767
{820B79FE-57D7-4539-A0CA-B668A0723B9B}.Debug|x64.ActiveCfg = Debug|x64
4868
{820B79FE-57D7-4539-A0CA-B668A0723B9B}.Debug|x64.Build.0 = Debug|x64
4969
{820B79FE-57D7-4539-A0CA-B668A0723B9B}.Debug|x86.ActiveCfg = Debug|Win32
5070
{820B79FE-57D7-4539-A0CA-B668A0723B9B}.Debug|x86.Build.0 = Debug|Win32
71+
{820B79FE-57D7-4539-A0CA-B668A0723B9B}.DebugDLL|x64.ActiveCfg = DebugDLL|x64
72+
{820B79FE-57D7-4539-A0CA-B668A0723B9B}.DebugDLL|x64.Build.0 = DebugDLL|x64
73+
{820B79FE-57D7-4539-A0CA-B668A0723B9B}.DebugDLL|x86.ActiveCfg = DebugDLL|Win32
74+
{820B79FE-57D7-4539-A0CA-B668A0723B9B}.DebugDLL|x86.Build.0 = DebugDLL|Win32
5175
{820B79FE-57D7-4539-A0CA-B668A0723B9B}.Release|x64.ActiveCfg = Release|x64
5276
{820B79FE-57D7-4539-A0CA-B668A0723B9B}.Release|x64.Build.0 = Release|x64
5377
{820B79FE-57D7-4539-A0CA-B668A0723B9B}.Release|x86.ActiveCfg = Release|Win32
5478
{820B79FE-57D7-4539-A0CA-B668A0723B9B}.Release|x86.Build.0 = Release|Win32
79+
{820B79FE-57D7-4539-A0CA-B668A0723B9B}.ReleaseDLL|x64.ActiveCfg = ReleaseDLL|x64
80+
{820B79FE-57D7-4539-A0CA-B668A0723B9B}.ReleaseDLL|x64.Build.0 = ReleaseDLL|x64
81+
{820B79FE-57D7-4539-A0CA-B668A0723B9B}.ReleaseDLL|x86.ActiveCfg = ReleaseDLL|Win32
82+
{820B79FE-57D7-4539-A0CA-B668A0723B9B}.ReleaseDLL|x86.Build.0 = ReleaseDLL|Win32
5583
{990D1E9C-75E0-4E17-8514-6DA0858BC17C}.Debug|x64.ActiveCfg = Debug|x64
5684
{990D1E9C-75E0-4E17-8514-6DA0858BC17C}.Debug|x64.Build.0 = Debug|x64
5785
{990D1E9C-75E0-4E17-8514-6DA0858BC17C}.Debug|x86.ActiveCfg = Debug|Win32
5886
{990D1E9C-75E0-4E17-8514-6DA0858BC17C}.Debug|x86.Build.0 = Debug|Win32
87+
{990D1E9C-75E0-4E17-8514-6DA0858BC17C}.DebugDLL|x64.ActiveCfg = DebugDLL|x64
88+
{990D1E9C-75E0-4E17-8514-6DA0858BC17C}.DebugDLL|x64.Build.0 = DebugDLL|x64
89+
{990D1E9C-75E0-4E17-8514-6DA0858BC17C}.DebugDLL|x86.ActiveCfg = DebugDLL|Win32
90+
{990D1E9C-75E0-4E17-8514-6DA0858BC17C}.DebugDLL|x86.Build.0 = DebugDLL|Win32
5991
{990D1E9C-75E0-4E17-8514-6DA0858BC17C}.Release|x64.ActiveCfg = Release|x64
6092
{990D1E9C-75E0-4E17-8514-6DA0858BC17C}.Release|x64.Build.0 = Release|x64
6193
{990D1E9C-75E0-4E17-8514-6DA0858BC17C}.Release|x86.ActiveCfg = Release|Win32
6294
{990D1E9C-75E0-4E17-8514-6DA0858BC17C}.Release|x86.Build.0 = Release|Win32
95+
{990D1E9C-75E0-4E17-8514-6DA0858BC17C}.ReleaseDLL|x64.ActiveCfg = ReleaseDLL|x64
96+
{990D1E9C-75E0-4E17-8514-6DA0858BC17C}.ReleaseDLL|x64.Build.0 = ReleaseDLL|x64
97+
{990D1E9C-75E0-4E17-8514-6DA0858BC17C}.ReleaseDLL|x86.ActiveCfg = ReleaseDLL|Win32
98+
{990D1E9C-75E0-4E17-8514-6DA0858BC17C}.ReleaseDLL|x86.Build.0 = ReleaseDLL|Win32
6399
EndGlobalSection
64100
GlobalSection(SolutionProperties) = preSolution
65101
HideSolutionNode = FALSE

VisualStudio/oqs/dll.def

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
LIBRARY oqs
2+
EXPORTS
3+
OQS_RAND_new
4+
OQS_RAND_free
5+
OQS_RAND_8
6+
OQS_RAND_32
7+
OQS_RAND_64
8+
OQS_RAND_n
9+
OQS_RAND_test_record_occurrence
10+
OQS_RAND_report_statistics
11+
OQS_KEX_new
12+
OQS_KEX_alice_0
13+
OQS_KEX_bob
14+
OQS_KEX_alice_1
15+
OQS_KEX_alice_priv_free
16+
OQS_KEX_free
17+
free

0 commit comments

Comments
 (0)