From 95b301161497fc936c95bfb1313f8ced26d8acd3 Mon Sep 17 00:00:00 2001 From: Shane Bryldt Date: Fri, 31 Mar 2017 13:06:43 -0600 Subject: [PATCH] FS-10167: Added windows compilation of libconfig and libsodium to support libblade, all of which now have windows projects and a new libblade solution containing everything. Blade compiles, but many warnings have been disabled and should be reviewed and fixed where reasonable towards clean compiling. Code Analysis has also been enabled for visual studio projects, warnings beginning with C6XXX can be ignored unless adding code-analysis macros to libks and libblade. --- libs/libblade/libblade.props | 14 + libs/libblade/libblade.sln | 148 ++++ libs/libblade/libblade.vcxproj | 253 +++++++ libs/libblade/libblade.vcxproj.filters | 141 ++++ libs/libblade/src/blade_module_wss.c | 2 +- libs/libblade/src/dht/ks_dht.c | 2 +- libs/libblade/src/include/blade.h | 4 + libs/libblade/src/include/ks_bencode.h | 2 +- libs/libblade/src/unqlite.c | 4 + libs/libks/libks.sln | 29 +- libs/libks/libks.vcxproj | 11 +- libs/libks/src/include/ks.h | 3 +- libs/libks/src/include/ks_socket.h | 1 + libs/libks/src/include/simclist.h | 56 +- libs/libks/src/ks_log.c | 27 +- libs/libks/src/simclist.c | 52 +- libs/libks/test/test_thread_pools.vcxproj | 3 - libs/libks/test/testacl.vcxproj | 3 - libs/libks/test/testwebsock.vcxproj | 3 - libs/win32/libconfig/libconfig.2015.vcxproj | 345 +++++++++ .../libconfig/libconfig.2015.vcxproj.filters | 57 ++ libs/win32/libsodium/libsodium.2015.vcxproj | 556 ++++++++++++++ .../libsodium/libsodium.2015.vcxproj.filters | 690 ++++++++++++++++++ 23 files changed, 2309 insertions(+), 97 deletions(-) create mode 100644 libs/libblade/libblade.props create mode 100644 libs/libblade/libblade.sln create mode 100644 libs/libblade/libblade.vcxproj create mode 100644 libs/libblade/libblade.vcxproj.filters create mode 100644 libs/win32/libconfig/libconfig.2015.vcxproj create mode 100644 libs/win32/libconfig/libconfig.2015.vcxproj.filters create mode 100644 libs/win32/libsodium/libsodium.2015.vcxproj create mode 100644 libs/win32/libsodium/libsodium.2015.vcxproj.filters diff --git a/libs/libblade/libblade.props b/libs/libblade/libblade.props new file mode 100644 index 0000000000..b4377683a3 --- /dev/null +++ b/libs/libblade/libblade.props @@ -0,0 +1,14 @@ + + + + + + + + UNICODE;SIMCLIST_NO_DUMPRESTORE;_CRT_SECURE_NO_WARNINGS;KS_EXPORTS;%(PreprocessorDefinitions) + $(ProjectDir)\src\include;%(AdditionalIncludeDirectories) + 4711;4574;4100;4127;4668;4255;4706;4710;4820 + + + + \ No newline at end of file diff --git a/libs/libblade/libblade.sln b/libs/libblade/libblade.sln new file mode 100644 index 0000000000..4e79f883b8 --- /dev/null +++ b/libs/libblade/libblade.sln @@ -0,0 +1,148 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 14 +VisualStudioVersion = 14.0.25420.1 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Download OPENSSL", "..\win32\Download OPENSSL.2015.vcxproj", "{D578E676-7EC8-4548-BD8B-845C635F14AD}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libeay32", "..\win32\openssl\libeay32.2015.vcxproj", "{D331904D-A00A-4694-A5A3-FCFF64AB5DBE}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ssleay32", "..\win32\openssl\ssleay32.2015.vcxproj", "{B4B62169-5AD4-4559-8707-3D933AC5DB39}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libks", "..\libks\libks.vcxproj", "{70D178D8-1100-4152-86C0-809A91CFF832}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libblade", "libblade.vcxproj", "{A89D6D18-6203-4149-9051-F8E798E7A3E7}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libsodium", "..\win32\libsodium\libsodium.2015.vcxproj", "{A185B162-6CB6-4502-B03F-B56F7699A8D9}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libconfig", "..\win32\libconfig\libconfig.2015.vcxproj", "{1A234565-926D-49B2-83E4-D56E0C38C9F2}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + DebugDLL|x64 = DebugDLL|x64 + DebugDLL|x86 = DebugDLL|x86 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + ReleaseDLL|x64 = ReleaseDLL|x64 + ReleaseDLL|x86 = ReleaseDLL|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {D578E676-7EC8-4548-BD8B-845C635F14AD}.Debug|x64.ActiveCfg = Debug|Win32 + {D578E676-7EC8-4548-BD8B-845C635F14AD}.Debug|x64.Build.0 = Debug|Win32 + {D578E676-7EC8-4548-BD8B-845C635F14AD}.Debug|x86.ActiveCfg = Debug|Win32 + {D578E676-7EC8-4548-BD8B-845C635F14AD}.Debug|x86.Build.0 = Debug|Win32 + {D578E676-7EC8-4548-BD8B-845C635F14AD}.DebugDLL|x64.ActiveCfg = Release|Win32 + {D578E676-7EC8-4548-BD8B-845C635F14AD}.DebugDLL|x64.Build.0 = Release|Win32 + {D578E676-7EC8-4548-BD8B-845C635F14AD}.DebugDLL|x86.ActiveCfg = Debug|Win32 + {D578E676-7EC8-4548-BD8B-845C635F14AD}.DebugDLL|x86.Build.0 = Debug|Win32 + {D578E676-7EC8-4548-BD8B-845C635F14AD}.Release|x64.ActiveCfg = Release|Win32 + {D578E676-7EC8-4548-BD8B-845C635F14AD}.Release|x64.Build.0 = Release|Win32 + {D578E676-7EC8-4548-BD8B-845C635F14AD}.Release|x86.ActiveCfg = Release|Win32 + {D578E676-7EC8-4548-BD8B-845C635F14AD}.Release|x86.Build.0 = Release|Win32 + {D578E676-7EC8-4548-BD8B-845C635F14AD}.ReleaseDLL|x64.ActiveCfg = Release|Win32 + {D578E676-7EC8-4548-BD8B-845C635F14AD}.ReleaseDLL|x64.Build.0 = Release|Win32 + {D578E676-7EC8-4548-BD8B-845C635F14AD}.ReleaseDLL|x86.ActiveCfg = Release|Win32 + {D578E676-7EC8-4548-BD8B-845C635F14AD}.ReleaseDLL|x86.Build.0 = Release|Win32 + {D331904D-A00A-4694-A5A3-FCFF64AB5DBE}.Debug|x64.ActiveCfg = Debug|x64 + {D331904D-A00A-4694-A5A3-FCFF64AB5DBE}.Debug|x64.Build.0 = Debug|x64 + {D331904D-A00A-4694-A5A3-FCFF64AB5DBE}.Debug|x86.ActiveCfg = Debug|Win32 + {D331904D-A00A-4694-A5A3-FCFF64AB5DBE}.Debug|x86.Build.0 = Debug|Win32 + {D331904D-A00A-4694-A5A3-FCFF64AB5DBE}.DebugDLL|x64.ActiveCfg = Debug|x64 + {D331904D-A00A-4694-A5A3-FCFF64AB5DBE}.DebugDLL|x64.Build.0 = Debug|x64 + {D331904D-A00A-4694-A5A3-FCFF64AB5DBE}.DebugDLL|x86.ActiveCfg = Debug|Win32 + {D331904D-A00A-4694-A5A3-FCFF64AB5DBE}.DebugDLL|x86.Build.0 = Debug|Win32 + {D331904D-A00A-4694-A5A3-FCFF64AB5DBE}.Release|x64.ActiveCfg = Release|x64 + {D331904D-A00A-4694-A5A3-FCFF64AB5DBE}.Release|x64.Build.0 = Release|x64 + {D331904D-A00A-4694-A5A3-FCFF64AB5DBE}.Release|x86.ActiveCfg = Release|Win32 + {D331904D-A00A-4694-A5A3-FCFF64AB5DBE}.Release|x86.Build.0 = Release|Win32 + {D331904D-A00A-4694-A5A3-FCFF64AB5DBE}.ReleaseDLL|x64.ActiveCfg = Release|x64 + {D331904D-A00A-4694-A5A3-FCFF64AB5DBE}.ReleaseDLL|x64.Build.0 = Release|x64 + {D331904D-A00A-4694-A5A3-FCFF64AB5DBE}.ReleaseDLL|x86.ActiveCfg = Release|Win32 + {D331904D-A00A-4694-A5A3-FCFF64AB5DBE}.ReleaseDLL|x86.Build.0 = Release|Win32 + {B4B62169-5AD4-4559-8707-3D933AC5DB39}.Debug|x64.ActiveCfg = Debug|x64 + {B4B62169-5AD4-4559-8707-3D933AC5DB39}.Debug|x64.Build.0 = Debug|x64 + {B4B62169-5AD4-4559-8707-3D933AC5DB39}.Debug|x86.ActiveCfg = Debug|Win32 + {B4B62169-5AD4-4559-8707-3D933AC5DB39}.Debug|x86.Build.0 = Debug|Win32 + {B4B62169-5AD4-4559-8707-3D933AC5DB39}.DebugDLL|x64.ActiveCfg = Debug|x64 + {B4B62169-5AD4-4559-8707-3D933AC5DB39}.DebugDLL|x64.Build.0 = Debug|x64 + {B4B62169-5AD4-4559-8707-3D933AC5DB39}.DebugDLL|x86.ActiveCfg = Debug|Win32 + {B4B62169-5AD4-4559-8707-3D933AC5DB39}.DebugDLL|x86.Build.0 = Debug|Win32 + {B4B62169-5AD4-4559-8707-3D933AC5DB39}.Release|x64.ActiveCfg = Release|x64 + {B4B62169-5AD4-4559-8707-3D933AC5DB39}.Release|x64.Build.0 = Release|x64 + {B4B62169-5AD4-4559-8707-3D933AC5DB39}.Release|x86.ActiveCfg = Release|Win32 + {B4B62169-5AD4-4559-8707-3D933AC5DB39}.Release|x86.Build.0 = Release|Win32 + {B4B62169-5AD4-4559-8707-3D933AC5DB39}.ReleaseDLL|x64.ActiveCfg = Release|x64 + {B4B62169-5AD4-4559-8707-3D933AC5DB39}.ReleaseDLL|x64.Build.0 = Release|x64 + {B4B62169-5AD4-4559-8707-3D933AC5DB39}.ReleaseDLL|x86.ActiveCfg = Release|Win32 + {B4B62169-5AD4-4559-8707-3D933AC5DB39}.ReleaseDLL|x86.Build.0 = Release|Win32 + {70D178D8-1100-4152-86C0-809A91CFF832}.Debug|x64.ActiveCfg = Debug|x64 + {70D178D8-1100-4152-86C0-809A91CFF832}.Debug|x64.Build.0 = Debug|x64 + {70D178D8-1100-4152-86C0-809A91CFF832}.Debug|x86.ActiveCfg = Debug|Win32 + {70D178D8-1100-4152-86C0-809A91CFF832}.Debug|x86.Build.0 = Debug|Win32 + {70D178D8-1100-4152-86C0-809A91CFF832}.DebugDLL|x64.ActiveCfg = Debug|x64 + {70D178D8-1100-4152-86C0-809A91CFF832}.DebugDLL|x64.Build.0 = Debug|x64 + {70D178D8-1100-4152-86C0-809A91CFF832}.DebugDLL|x86.ActiveCfg = Debug|Win32 + {70D178D8-1100-4152-86C0-809A91CFF832}.DebugDLL|x86.Build.0 = Debug|Win32 + {70D178D8-1100-4152-86C0-809A91CFF832}.Release|x64.ActiveCfg = Release|x64 + {70D178D8-1100-4152-86C0-809A91CFF832}.Release|x64.Build.0 = Release|x64 + {70D178D8-1100-4152-86C0-809A91CFF832}.Release|x86.ActiveCfg = Release|Win32 + {70D178D8-1100-4152-86C0-809A91CFF832}.Release|x86.Build.0 = Release|Win32 + {70D178D8-1100-4152-86C0-809A91CFF832}.ReleaseDLL|x64.ActiveCfg = Release|x64 + {70D178D8-1100-4152-86C0-809A91CFF832}.ReleaseDLL|x64.Build.0 = Release|x64 + {70D178D8-1100-4152-86C0-809A91CFF832}.ReleaseDLL|x86.ActiveCfg = Release|Win32 + {70D178D8-1100-4152-86C0-809A91CFF832}.ReleaseDLL|x86.Build.0 = Release|Win32 + {A89D6D18-6203-4149-9051-F8E798E7A3E7}.Debug|x64.ActiveCfg = Debug|x64 + {A89D6D18-6203-4149-9051-F8E798E7A3E7}.Debug|x64.Build.0 = Debug|x64 + {A89D6D18-6203-4149-9051-F8E798E7A3E7}.Debug|x86.ActiveCfg = Debug|Win32 + {A89D6D18-6203-4149-9051-F8E798E7A3E7}.Debug|x86.Build.0 = Debug|Win32 + {A89D6D18-6203-4149-9051-F8E798E7A3E7}.DebugDLL|x64.ActiveCfg = Debug|x64 + {A89D6D18-6203-4149-9051-F8E798E7A3E7}.DebugDLL|x64.Build.0 = Debug|x64 + {A89D6D18-6203-4149-9051-F8E798E7A3E7}.DebugDLL|x86.ActiveCfg = Debug|Win32 + {A89D6D18-6203-4149-9051-F8E798E7A3E7}.DebugDLL|x86.Build.0 = Debug|Win32 + {A89D6D18-6203-4149-9051-F8E798E7A3E7}.Release|x64.ActiveCfg = Release|x64 + {A89D6D18-6203-4149-9051-F8E798E7A3E7}.Release|x64.Build.0 = Release|x64 + {A89D6D18-6203-4149-9051-F8E798E7A3E7}.Release|x86.ActiveCfg = Release|Win32 + {A89D6D18-6203-4149-9051-F8E798E7A3E7}.Release|x86.Build.0 = Release|Win32 + {A89D6D18-6203-4149-9051-F8E798E7A3E7}.ReleaseDLL|x64.ActiveCfg = Release|x64 + {A89D6D18-6203-4149-9051-F8E798E7A3E7}.ReleaseDLL|x64.Build.0 = Release|x64 + {A89D6D18-6203-4149-9051-F8E798E7A3E7}.ReleaseDLL|x86.ActiveCfg = Release|Win32 + {A89D6D18-6203-4149-9051-F8E798E7A3E7}.ReleaseDLL|x86.Build.0 = Release|Win32 + {A185B162-6CB6-4502-B03F-B56F7699A8D9}.Debug|x64.ActiveCfg = DebugDLL|x64 + {A185B162-6CB6-4502-B03F-B56F7699A8D9}.Debug|x64.Build.0 = DebugDLL|x64 + {A185B162-6CB6-4502-B03F-B56F7699A8D9}.Debug|x86.ActiveCfg = Debug|Win32 + {A185B162-6CB6-4502-B03F-B56F7699A8D9}.Debug|x86.Build.0 = Debug|Win32 + {A185B162-6CB6-4502-B03F-B56F7699A8D9}.DebugDLL|x64.ActiveCfg = DebugDLL|x64 + {A185B162-6CB6-4502-B03F-B56F7699A8D9}.DebugDLL|x64.Build.0 = DebugDLL|x64 + {A185B162-6CB6-4502-B03F-B56F7699A8D9}.DebugDLL|x86.ActiveCfg = DebugDLL|Win32 + {A185B162-6CB6-4502-B03F-B56F7699A8D9}.DebugDLL|x86.Build.0 = DebugDLL|Win32 + {A185B162-6CB6-4502-B03F-B56F7699A8D9}.Release|x64.ActiveCfg = ReleaseDLL|x64 + {A185B162-6CB6-4502-B03F-B56F7699A8D9}.Release|x64.Build.0 = ReleaseDLL|x64 + {A185B162-6CB6-4502-B03F-B56F7699A8D9}.Release|x86.ActiveCfg = Release|Win32 + {A185B162-6CB6-4502-B03F-B56F7699A8D9}.Release|x86.Build.0 = Release|Win32 + {A185B162-6CB6-4502-B03F-B56F7699A8D9}.ReleaseDLL|x64.ActiveCfg = ReleaseDLL|x64 + {A185B162-6CB6-4502-B03F-B56F7699A8D9}.ReleaseDLL|x64.Build.0 = ReleaseDLL|x64 + {A185B162-6CB6-4502-B03F-B56F7699A8D9}.ReleaseDLL|x86.ActiveCfg = ReleaseDLL|Win32 + {A185B162-6CB6-4502-B03F-B56F7699A8D9}.ReleaseDLL|x86.Build.0 = ReleaseDLL|Win32 + {1A234565-926D-49B2-83E4-D56E0C38C9F2}.Debug|x64.ActiveCfg = DebugDLL|x64 + {1A234565-926D-49B2-83E4-D56E0C38C9F2}.Debug|x64.Build.0 = DebugDLL|x64 + {1A234565-926D-49B2-83E4-D56E0C38C9F2}.Debug|x86.ActiveCfg = Debug|Win32 + {1A234565-926D-49B2-83E4-D56E0C38C9F2}.Debug|x86.Build.0 = Debug|Win32 + {1A234565-926D-49B2-83E4-D56E0C38C9F2}.DebugDLL|x64.ActiveCfg = DebugDLL|x64 + {1A234565-926D-49B2-83E4-D56E0C38C9F2}.DebugDLL|x64.Build.0 = DebugDLL|x64 + {1A234565-926D-49B2-83E4-D56E0C38C9F2}.DebugDLL|x86.ActiveCfg = DebugDLL|Win32 + {1A234565-926D-49B2-83E4-D56E0C38C9F2}.DebugDLL|x86.Build.0 = DebugDLL|Win32 + {1A234565-926D-49B2-83E4-D56E0C38C9F2}.Release|x64.ActiveCfg = ReleaseDLL|x64 + {1A234565-926D-49B2-83E4-D56E0C38C9F2}.Release|x64.Build.0 = ReleaseDLL|x64 + {1A234565-926D-49B2-83E4-D56E0C38C9F2}.Release|x86.ActiveCfg = Release|Win32 + {1A234565-926D-49B2-83E4-D56E0C38C9F2}.Release|x86.Build.0 = Release|Win32 + {1A234565-926D-49B2-83E4-D56E0C38C9F2}.ReleaseDLL|x64.ActiveCfg = ReleaseDLL|x64 + {1A234565-926D-49B2-83E4-D56E0C38C9F2}.ReleaseDLL|x64.Build.0 = ReleaseDLL|x64 + {1A234565-926D-49B2-83E4-D56E0C38C9F2}.ReleaseDLL|x86.ActiveCfg = ReleaseDLL|Win32 + {1A234565-926D-49B2-83E4-D56E0C38C9F2}.ReleaseDLL|x86.Build.0 = ReleaseDLL|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/libs/libblade/libblade.vcxproj b/libs/libblade/libblade.vcxproj new file mode 100644 index 0000000000..fcfe6d5d62 --- /dev/null +++ b/libs/libblade/libblade.vcxproj @@ -0,0 +1,253 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + {A89D6D18-6203-4149-9051-F8E798E7A3E7} + Win32Proj + 8.1 + + + + DynamicLibrary + true + v140 + Unicode + + + DynamicLibrary + false + v140 + Unicode + + + DynamicLibrary + true + v140 + Unicode + + + DynamicLibrary + false + v140 + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(Platform)\$(Configuration)\ + $(SolutionDir)$(Platform)\$(Configuration)\ + $(SolutionDir);$(SolutionDir)..\libks\src\include;$(SolutionDir)..\libsodium-$(SodiumVersion)\src\libsodium\include;$(SolutionDir)..\libconfig-$(ConfigVersion)\lib;$(IncludePath) + $(LibraryPath) + C:\Program Files (x86)\Microsoft Visual Studio 14.0\Team Tools\Static Analysis Tools\Rule Sets\NativeRecommendedRules.ruleset + true + + + + + $(Platform)\$(Configuration)\ + $(SolutionDir)$(Platform)\$(Configuration)\ + $(SolutionDir);$(SolutionDir)..\libks\src\include;$(SolutionDir)..\libsodium-$(SodiumVersion)\src\libsodium\include;$(SolutionDir)..\libconfig-$(ConfigVersion)\lib;$(IncludePath) + $(LibraryPath) + + + $(SolutionDir);$(SolutionDir)..\libks\src\include;$(SolutionDir)..\libsodium-$(SodiumVersion)\src\libsodium\include;$(SolutionDir)..\libconfig-$(ConfigVersion)\lib;$(IncludePath) + $(LibraryPath) + C:\Program Files (x86)\Microsoft Visual Studio 14.0\Team Tools\Static Analysis Tools\Rule Sets\NativeRecommendedRules.ruleset + true + + + $(SolutionDir);$(SolutionDir)..\libks\src\include;$(SolutionDir)..\libsodium-$(SodiumVersion)\src\libsodium\include;$(SolutionDir)..\libconfig-$(ConfigVersion)\lib;$(IncludePath) + $(LibraryPath) + + + + WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBKS_EXPORTS;CJSON_EXPORT_SYMBOLS;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + EnableAllWarnings + ProgramDatabase + Disabled + $(SolutionDir)..\win32\openssl\include;$(SolutionDir)..\win32\openssl\include_x86;%(AdditionalIncludeDirectories) + true + true + 4711;4574;4100;4127;4668;4255;4706;4710;4820;4090;4702;4456;4242;4457;4459;4244;4324;4204;4388;4245;4267 + true + false + true + + + MachineX86 + true + Windows + Rpcrt4.lib;Crypt32.lib;%(AdditionalDependencies) + + + + + WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBKS_EXPORTS;CJSON_EXPORT_SYMBOLS;%(PreprocessorDefinitions) + MultiThreadedDLL + EnableAllWarnings + ProgramDatabase + $(SolutionDir)..\win32\openssl\include;$(SolutionDir)..\win32\openssl\include_x86;%(AdditionalIncludeDirectories) + true + true + 4711;4574;4100;4127;4668;4255;4706;4710;4820;4090;4702;4456;4242;4457;4459;4244;4324;4204;4388;4245;4267 + true + + + MachineX86 + true + Windows + true + true + Rpcrt4.lib;Crypt32.lib;%(AdditionalDependencies) + + + + + $(SolutionDir)..\win32\openssl\include;$(SolutionDir)..\win32\openssl\include_x64;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBKS_EXPORTS;CJSON_EXPORT_SYMBOLS;%(PreprocessorDefinitions) + EditAndContinue + EnableAllWarnings + true + true + 4711;4574;4100;4127;4668;4255;4706;4710;4820;4090;4702;4456;4242;4457;4459;4244;4324;4204;4388;4245;4267 + true + false + true + + + Windows + Debug + Rpcrt4.lib;Crypt32.lib;%(AdditionalDependencies) + + + + + $(SolutionDir)..\win32\openssl\include;$(SolutionDir)..\win32\openssl\include_x64;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBKS_EXPORTS;CJSON_EXPORT_SYMBOLS;%(PreprocessorDefinitions) + EnableAllWarnings + true + true + 4711;4574;4100;4127;4668;4255;4706;4710;4820;4090;4702;4456;4242;4457;4459;4244;4324;4204;4388;4245;4267 + true + + + Windows + Rpcrt4.lib;Crypt32.lib;%(AdditionalDependencies) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {70d178d8-1100-4152-86c0-809a91cff832} + + + {1a234565-926d-49b2-83e4-d56e0c38c9f2} + + + {a185b162-6cb6-4502-b03f-b56f7699a8d9} + + + {d331904d-a00a-4694-a5a3-fcff64ab5dbe} + + + {b4b62169-5ad4-4559-8707-3d933ac5db39} + + + + + + \ No newline at end of file diff --git a/libs/libblade/libblade.vcxproj.filters b/libs/libblade/libblade.vcxproj.filters new file mode 100644 index 0000000000..dd3696e575 --- /dev/null +++ b/libs/libblade/libblade.vcxproj.filters @@ -0,0 +1,141 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + \ No newline at end of file diff --git a/libs/libblade/src/blade_module_wss.c b/libs/libblade/src/blade_module_wss.c index 107a8420d3..c270321cb3 100644 --- a/libs/libblade/src/blade_module_wss.c +++ b/libs/libblade/src/blade_module_wss.c @@ -756,7 +756,7 @@ ks_status_t blade_transport_wss_write(blade_transport_wss_t *bt_wss, cJSON *json } // @todo determine if WSOC_TEXT null terminates when read_frame is called, or if it's safe to include like this json_str_len = strlen(json_str) + 1; - if (kws_write_frame(bt_wss->kws, WSOC_TEXT, json_str, json_str_len) != json_str_len) { + if ((ks_size_t)kws_write_frame(bt_wss->kws, WSOC_TEXT, json_str, json_str_len) != json_str_len) { ks_log(KS_LOG_DEBUG, "Failed to write frame\n"); ret = KS_STATUS_FAIL; goto done; diff --git a/libs/libblade/src/dht/ks_dht.c b/libs/libblade/src/dht/ks_dht.c index a70adef12b..9e9c530d12 100644 --- a/libs/libblade/src/dht/ks_dht.c +++ b/libs/libblade/src/dht/ks_dht.c @@ -1613,7 +1613,7 @@ KS_DECLARE(ks_status_t) ks_dht_process_response(ks_dht_t *dht, ks_dht_message_t { struct bencode *r; ks_dht_nodeid_t *id; - ks_dht_node_t *node; + ks_dht_node_t *node = NULL; ks_dht_transaction_t *transaction; uint32_t *tid; uint32_t transactionid; diff --git a/libs/libblade/src/include/blade.h b/libs/libblade/src/include/blade.h index 9e41a1fc76..b79242c709 100644 --- a/libs/libblade/src/include/blade.h +++ b/libs/libblade/src/include/blade.h @@ -53,6 +53,10 @@ KS_BEGIN_EXTERN_C +#ifndef config_lookup_from +#define config_lookup_from config_setting_lookup +#endif + KS_DECLARE(ks_status_t) blade_init(void); KS_DECLARE(ks_status_t) blade_shutdown(void); diff --git a/libs/libblade/src/include/ks_bencode.h b/libs/libblade/src/include/ks_bencode.h index d2257795f6..61c373ee5f 100644 --- a/libs/libblade/src/include/ks_bencode.h +++ b/libs/libblade/src/include/ks_bencode.h @@ -19,7 +19,7 @@ extern "C" { #ifdef __GNUC__ #define BEN_CHECK_FORMAT(...) __attribute__ ((format( __VA_ARGS__ ))) #else -#define BEN_CHECK_FORMAT(args) +#define BEN_CHECK_FORMAT(...) #endif enum { diff --git a/libs/libblade/src/unqlite.c b/libs/libblade/src/unqlite.c index 3e6538b9b9..ee79ffaa00 100644 --- a/libs/libblade/src/unqlite.c +++ b/libs/libblade/src/unqlite.c @@ -1,5 +1,7 @@ +#ifndef _WIN32 #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-but-set-variable" +#endif /* * Symisc unQLite: An Embeddable NoSQL (Post Modern) Database Engine. @@ -60233,4 +60235,6 @@ UNQLITE_PRIVATE int unqliteRegisterJx9Functions(unqlite_vm *pVm) * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#ifndef _WIN32 #pragma GCC diagnostic pop +#endif \ No newline at end of file diff --git a/libs/libks/libks.sln b/libs/libks/libks.sln index a5c692585c..592e5500d5 100644 --- a/libs/libks/libks.sln +++ b/libs/libks/libks.sln @@ -25,11 +25,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_thread_pools", "test\t EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Download OPENSSL", "..\win32\Download OPENSSL.2015.vcxproj", "{D578E676-7EC8-4548-BD8B-845C635F14AD}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "openssl", "..\win32\openssl\openssl.2015.vcxproj", "{25BD39B1-C8BF-4676-A738-9CABD9C6BC79}" - ProjectSection(ProjectDependencies) = postProject - {D578E676-7EC8-4548-BD8B-845C635F14AD} = {D578E676-7EC8-4548-BD8B-845C635F14AD} - EndProjectSection -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libeay32", "..\win32\openssl\libeay32.2015.vcxproj", "{D331904D-A00A-4694-A5A3-FCFF64AB5DBE}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ssleay32", "..\win32\openssl\ssleay32.2015.vcxproj", "{B4B62169-5AD4-4559-8707-3D933AC5DB39}" @@ -106,14 +101,6 @@ Global {90D1C15C-59B0-470F-B18A-DA355948C736}.Release|x64.Build.0 = Release|x64 {90D1C15C-59B0-470F-B18A-DA355948C736}.Release|x86.ActiveCfg = Release|Win32 {90D1C15C-59B0-470F-B18A-DA355948C736}.Release|x86.Build.0 = Release|Win32 - {8AFFECE6-2A0B-4D44-990C-6D3DD832A250}.Debug|x64.ActiveCfg = Debug|x64 - {8AFFECE6-2A0B-4D44-990C-6D3DD832A250}.Debug|x64.Build.0 = Debug|x64 - {8AFFECE6-2A0B-4D44-990C-6D3DD832A250}.Debug|x86.ActiveCfg = Debug|Win32 - {8AFFECE6-2A0B-4D44-990C-6D3DD832A250}.Debug|x86.Build.0 = Debug|Win32 - {8AFFECE6-2A0B-4D44-990C-6D3DD832A250}.Release|x64.ActiveCfg = Release|x64 - {8AFFECE6-2A0B-4D44-990C-6D3DD832A250}.Release|x64.Build.0 = Release|x64 - {8AFFECE6-2A0B-4D44-990C-6D3DD832A250}.Release|x86.ActiveCfg = Release|Win32 - {8AFFECE6-2A0B-4D44-990C-6D3DD832A250}.Release|x86.Build.0 = Release|Win32 {1E6DE729-F4D4-4455-B64C-73B31C17E12C}.Debug|x64.ActiveCfg = Debug|x64 {1E6DE729-F4D4-4455-B64C-73B31C17E12C}.Debug|x64.Build.0 = Debug|x64 {1E6DE729-F4D4-4455-B64C-73B31C17E12C}.Debug|x86.ActiveCfg = Debug|Win32 @@ -122,6 +109,14 @@ Global {1E6DE729-F4D4-4455-B64C-73B31C17E12C}.Release|x64.Build.0 = Release|x64 {1E6DE729-F4D4-4455-B64C-73B31C17E12C}.Release|x86.ActiveCfg = Release|Win32 {1E6DE729-F4D4-4455-B64C-73B31C17E12C}.Release|x86.Build.0 = Release|Win32 + {8AFFECE6-2A0B-4D44-990C-6D3DD832A250}.Debug|x64.ActiveCfg = Debug|x64 + {8AFFECE6-2A0B-4D44-990C-6D3DD832A250}.Debug|x64.Build.0 = Debug|x64 + {8AFFECE6-2A0B-4D44-990C-6D3DD832A250}.Debug|x86.ActiveCfg = Debug|Win32 + {8AFFECE6-2A0B-4D44-990C-6D3DD832A250}.Debug|x86.Build.0 = Debug|Win32 + {8AFFECE6-2A0B-4D44-990C-6D3DD832A250}.Release|x64.ActiveCfg = Release|x64 + {8AFFECE6-2A0B-4D44-990C-6D3DD832A250}.Release|x64.Build.0 = Release|x64 + {8AFFECE6-2A0B-4D44-990C-6D3DD832A250}.Release|x86.ActiveCfg = Release|Win32 + {8AFFECE6-2A0B-4D44-990C-6D3DD832A250}.Release|x86.Build.0 = Release|Win32 {D578E676-7EC8-4548-BD8B-845C635F14AD}.Debug|x64.ActiveCfg = Debug|Win32 {D578E676-7EC8-4548-BD8B-845C635F14AD}.Debug|x64.Build.0 = Debug|Win32 {D578E676-7EC8-4548-BD8B-845C635F14AD}.Debug|x86.ActiveCfg = Debug|Win32 @@ -130,14 +125,6 @@ Global {D578E676-7EC8-4548-BD8B-845C635F14AD}.Release|x64.Build.0 = Release|Win32 {D578E676-7EC8-4548-BD8B-845C635F14AD}.Release|x86.ActiveCfg = Release|Win32 {D578E676-7EC8-4548-BD8B-845C635F14AD}.Release|x86.Build.0 = Release|Win32 - {25BD39B1-C8BF-4676-A738-9CABD9C6BC79}.Debug|x64.ActiveCfg = Debug|x64 - {25BD39B1-C8BF-4676-A738-9CABD9C6BC79}.Debug|x64.Build.0 = Debug|x64 - {25BD39B1-C8BF-4676-A738-9CABD9C6BC79}.Debug|x86.ActiveCfg = Debug|Win32 - {25BD39B1-C8BF-4676-A738-9CABD9C6BC79}.Debug|x86.Build.0 = Debug|Win32 - {25BD39B1-C8BF-4676-A738-9CABD9C6BC79}.Release|x64.ActiveCfg = Release|x64 - {25BD39B1-C8BF-4676-A738-9CABD9C6BC79}.Release|x64.Build.0 = Release|x64 - {25BD39B1-C8BF-4676-A738-9CABD9C6BC79}.Release|x86.ActiveCfg = Release|Win32 - {25BD39B1-C8BF-4676-A738-9CABD9C6BC79}.Release|x86.Build.0 = Release|Win32 {D331904D-A00A-4694-A5A3-FCFF64AB5DBE}.Debug|x64.ActiveCfg = Debug|x64 {D331904D-A00A-4694-A5A3-FCFF64AB5DBE}.Debug|x64.Build.0 = Debug|x64 {D331904D-A00A-4694-A5A3-FCFF64AB5DBE}.Debug|x86.ActiveCfg = Debug|Win32 diff --git a/libs/libks/libks.vcxproj b/libs/libks/libks.vcxproj index 4a9206f47b..654341272b 100644 --- a/libs/libks/libks.vcxproj +++ b/libs/libks/libks.vcxproj @@ -78,7 +78,7 @@ true $(Platform)\$(Configuration)\ $(SolutionDir)$(Platform)\$(Configuration)\ - $(SolutionDir);$(SolutionDir)\crypt;$(IncludePath) + $(ProjectDir);$(ProjectDir)\crypt;$(IncludePath) $(LibraryPath) C:\Program Files (x86)\Microsoft Visual Studio 14.0\Team Tools\Static Analysis Tools\Rule Sets\NativeRecommendedRules.ruleset true @@ -88,17 +88,17 @@ $(Platform)\$(Configuration)\ $(SolutionDir)$(Platform)\$(Configuration)\ - $(SolutionDir);$(SolutionDir)\crypt;$(IncludePath) + $(ProjectDir);$(ProjectDir)\crypt;$(IncludePath) $(LibraryPath) - $(SolutionDir);$(SolutionDir)\crypt;$(IncludePath) + $(ProjectDir);$(ProjectDir)\crypt;$(IncludePath) $(LibraryPath) C:\Program Files (x86)\Microsoft Visual Studio 14.0\Team Tools\Static Analysis Tools\Rule Sets\NativeRecommendedRules.ruleset true - $(SolutionDir);$(SolutionDir)\crypt;$(IncludePath) + $(ProjectDir);$(ProjectDir)\crypt;$(IncludePath) $(LibraryPath) @@ -246,9 +246,6 @@ {d331904d-a00a-4694-a5a3-fcff64ab5dbe} - - {25bd39b1-c8bf-4676-a738-9cabd9c6bc79} - {b4b62169-5ad4-4559-8707-3d933ac5db39} diff --git a/libs/libks/src/include/ks.h b/libs/libks/src/include/ks.h index 7cfea68597..d709ba5a12 100644 --- a/libs/libks/src/include/ks.h +++ b/libs/libks/src/include/ks.h @@ -84,7 +84,8 @@ KS_DECLARE(ks_pool_t *) ks_global_pool(void); KS_DECLARE(ks_status_t) ks_global_set_cleanup(ks_pool_cleanup_fn_t fn, void *arg); KS_DECLARE(int) ks_vasprintf(char **ret, const char *fmt, va_list ap); -KS_DECLARE_DATA extern ks_logger_t ks_log; +//KS_DECLARE_DATA extern ks_logger_t ks_logger; +KS_DECLARE(void) ks_log(const char *file, const char *func, int line, int level, const char *fmt, ...); /*! Sets the logger for libks. Default is the null_logger */ KS_DECLARE(void) ks_global_set_logger(ks_logger_t logger); diff --git a/libs/libks/src/include/ks_socket.h b/libs/libks/src/include/ks_socket.h index 1939bc036b..b72d73d2b3 100644 --- a/libs/libks/src/include/ks_socket.h +++ b/libs/libks/src/include/ks_socket.h @@ -45,6 +45,7 @@ KS_BEGIN_EXTERN_C #define KS_SO_NONBLOCK 2999 #ifdef WIN32 +#define SHUT_RDWR SD_BOTH static __inline int ks_errno(void) { diff --git a/libs/libks/src/include/simclist.h b/libs/libks/src/include/simclist.h index 73186a7f7f..495f52159a 100755 --- a/libs/libks/src/include/simclist.h +++ b/libs/libks/src/include/simclist.h @@ -45,8 +45,12 @@ extern "C" { #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* "inline" and "restrict" are keywords */ #else +#ifndef inline # define inline /* inline */ +#endif +#ifndef restrict # define restrict /* restrict */ +#endif #endif @@ -210,7 +214,7 @@ extern "C" { * @param l must point to a user-provided memory location * @return 0 for success. -1 for failure */ - int list_init(list_t *restrict l); + KS_DECLARE(int) list_init(list_t *restrict l); /** * completely remove the list from memory. @@ -221,7 +225,7 @@ extern "C" { * * @param l list to destroy */ - void list_destroy(list_t *restrict l); + KS_DECLARE(void) list_destroy(list_t *restrict l); /** * set the comparator function for list elements. @@ -356,7 +360,7 @@ extern "C" { * * @return 1 for success. < 0 for failure */ - int list_append(list_t *restrict l, const void *data); + KS_DECLARE(int) list_append(list_t *restrict l, const void *data); /** * insert data in the head of the list. @@ -368,7 +372,7 @@ extern "C" { * * @return 1 for success. < 0 for failure */ - int list_prepend(list_t *restrict l, const void *restrict data); + KS_DECLARE(int) list_prepend(list_t *restrict l, const void *restrict data); /** * extract the element in the top of the list. @@ -378,7 +382,7 @@ extern "C" { * @param l list to operate * @return reference to user datum, or NULL on errors */ - void *list_fetch(list_t *restrict l); + KS_DECLARE(void *) list_fetch(list_t *restrict l); /** * retrieve an element at a given position. @@ -387,7 +391,7 @@ extern "C" { * @param pos [0,size-1] position index of the element wanted * @return reference to user datum, or NULL on errors */ - void *list_get_at(const list_t *restrict l, unsigned int pos); + KS_DECLARE(void *) list_get_at(const list_t *restrict l, unsigned int pos); /** * return the maximum element of the list. @@ -401,7 +405,7 @@ extern "C" { * @param l list to operate * @return the reference to the element, or NULL */ - void *list_get_max(const list_t *restrict l); + KS_DECLARE(void *) list_get_max(const list_t *restrict l); /** * return the minimum element of the list. @@ -415,7 +419,7 @@ extern "C" { * @param l list to operate * @return the reference to the element, or NULL */ - void *list_get_min(const list_t *restrict l); + KS_DECLARE(void *) list_get_min(const list_t *restrict l); /** * retrieve and remove from list an element at a given position. @@ -424,7 +428,7 @@ extern "C" { * @param pos [0,size-1] position index of the element wanted * @return reference to user datum, or NULL on errors */ - void *list_extract_at(list_t *restrict l, unsigned int pos); + KS_DECLARE(void *) list_extract_at(list_t *restrict l, unsigned int pos); /** * insert an element at a given position. @@ -434,7 +438,7 @@ extern "C" { * @param pos [0,size-1] position index to insert the element at * @return positive value on success. Negative on failure */ - int list_insert_at(list_t *restrict l, const void *data, unsigned int pos); + KS_DECLARE(int) list_insert_at(list_t *restrict l, const void *data, unsigned int pos); /** * expunge the first found given element from the list. @@ -451,7 +455,7 @@ extern "C" { * @see list_attributes_comparator() * @see list_delete_at() */ - int list_delete(list_t *restrict l, const void *data); + KS_DECLARE(int) list_delete(list_t *restrict l, const void *data); /** * expunge an element at a given position from the list. @@ -460,7 +464,7 @@ extern "C" { * @param pos [0,size-1] position index of the element to be deleted * @return 0 on success. Negative value on failure */ - int list_delete_at(list_t *restrict l, unsigned int pos); + KS_DECLARE(int) list_delete_at(list_t *restrict l, unsigned int pos); /** * expunge an array of elements from the list, given their position range. @@ -470,7 +474,7 @@ extern "C" { * @param posend [posstart,size-1] position of the last element to be deleted * @return the number of elements successfully removed on success, <0 on error */ - int list_delete_range(list_t *restrict l, unsigned int posstart, unsigned int posend); + KS_DECLARE(int) list_delete_range(list_t *restrict l, unsigned int posstart, unsigned int posend); /** * clear all the elements off of the list. @@ -483,7 +487,7 @@ extern "C" { * @param l list to operate * @return the number of elements removed on success, <0 on error */ - int list_clear(list_t *restrict l); + KS_DECLARE(int) list_clear(list_t *restrict l); /** * inspect the number of elements in the list. @@ -491,7 +495,7 @@ extern "C" { * @param l list to operate * @return number of elements currently held by the list */ - unsigned int list_size(const list_t *restrict l); + KS_DECLARE(unsigned int) list_size(const list_t *restrict l); /** * inspect whether the list is empty. @@ -501,7 +505,7 @@ extern "C" { * * @see list_size() */ - int list_empty(const list_t *restrict l); + KS_DECLARE(int) list_empty(const list_t *restrict l); /** * find the position of an element in a list. @@ -520,7 +524,7 @@ extern "C" { * @see list_attributes_comparator() * @see list_get_at() */ - int list_locate(const list_t *restrict l, const void *data); + KS_DECLARE(int) list_locate(const list_t *restrict l, const void *data); /** * returns an element given an indicator. @@ -535,7 +539,7 @@ extern "C" { * @param indicator indicator data to pass to the seeker along with elements * @return reference to the element accepted by the seeker, or NULL if none found */ - void *list_seek(list_t *restrict l, const void *indicator); + KS_DECLARE(void *) list_seek(list_t *restrict l, const void *indicator); /** * inspect whether some data is member of the list. @@ -556,7 +560,7 @@ extern "C" { * * @see list_attributes_comparator() */ - int list_contains(const list_t *restrict l, const void *data); + KS_DECLARE(int) list_contains(const list_t *restrict l, const void *data); /** * concatenate two lists @@ -575,7 +579,7 @@ extern "C" { * @param dest reference to the destination list * @return 0 for success, -1 for errors */ - int list_concat(const list_t *l1, const list_t *l2, list_t *restrict dest); + KS_DECLARE(int) list_concat(const list_t *l1, const list_t *l2, list_t *restrict dest); /** * sort list elements. @@ -592,7 +596,7 @@ extern "C" { * * @see list_attributes_comparator() */ - int list_sort(list_t *restrict l, int versus); + KS_DECLARE(int) list_sort(list_t *restrict l, int versus); /** * start an iteration session. @@ -604,7 +608,7 @@ extern "C" { * * @see list_iterator_stop() */ - int list_iterator_start(list_t *restrict l); + KS_DECLARE(int) list_iterator_start(list_t *restrict l); /** * return the next element in the iteration session. @@ -612,7 +616,7 @@ extern "C" { * @param l list to operate * @return element datum, or NULL on errors */ - void *list_iterator_next(list_t *restrict l); + KS_DECLARE(void *) list_iterator_next(list_t *restrict l); /** * inspect whether more elements are available in the iteration session. @@ -620,7 +624,7 @@ extern "C" { * @param l list to operate * @return 0 iff no more elements are available. */ - int list_iterator_hasnext(const list_t *restrict l); + KS_DECLARE(int) list_iterator_hasnext(const list_t *restrict l); /** * end an iteration session. @@ -628,7 +632,7 @@ extern "C" { * @param l list to operate * @return 0 iff the iteration session cannot be stopped */ - int list_iterator_stop(list_t *restrict l); + KS_DECLARE(int) list_iterator_stop(list_t *restrict l); /** * return the hash of the current status of the list. @@ -638,7 +642,7 @@ extern "C" { * * @return 0 for success; <0 for failure */ - int list_hash(const list_t *restrict l, list_hash_t *restrict hash); + KS_DECLARE(int) list_hash(const list_t *restrict l, list_hash_t *restrict hash); #ifndef SIMCLIST_NO_DUMPRESTORE /** diff --git a/libs/libks/src/ks_log.c b/libs/libks/src/ks_log.c index b8642122c7..cdcbc41b2e 100644 --- a/libs/libks/src/ks_log.c +++ b/libs/libks/src/ks_log.c @@ -131,14 +131,14 @@ static void default_logger(const char *file, const char *func, int line, int lev } -ks_logger_t ks_log = null_logger; +ks_logger_t ks_logger = null_logger; KS_DECLARE(void) ks_global_set_logger(ks_logger_t logger) { if (logger) { - ks_log = logger; + ks_logger = logger; } else { - ks_log = null_logger; + ks_logger = null_logger; } } @@ -148,7 +148,7 @@ KS_DECLARE(void) ks_global_set_default_logger(int level) level = 7; } - ks_log = default_logger; + ks_logger = default_logger; ks_log_level = level; } @@ -156,3 +156,22 @@ KS_DECLARE(void) ks_global_set_default_logger_prefix(ks_log_prefix_t prefix) { ks_log_prefix = prefix; } + +KS_DECLARE(void) ks_log(const char *file, const char *func, int line, int level, const char *fmt, ...) +{ + char *data; + va_list ap; + + if (!ks_logger) return; + + va_start(ap, fmt); + + if (ks_vasprintf(&data, fmt, ap) != -1) { + ks_logger(file, func, line, level, "%s", data); + //fprintf(stderr, "[%s] %s:%d %s() %s", LEVEL_NAMES[level], fp, line, func, data); + //fprintf(stderr, "%s", buf); + free(data); + } + + va_end(ap); +} diff --git a/libs/libks/src/simclist.c b/libs/libks/src/simclist.c index 78dda9af14..04c1f81457 100755 --- a/libs/libks/src/simclist.c +++ b/libs/libks/src/simclist.c @@ -267,7 +267,7 @@ static inline long get_random(void) { /* list initialization */ -int list_init(list_t *restrict l) { +KS_DECLARE(int) list_init(list_t *restrict l) { if (l == NULL) return -1; seed_random(); @@ -303,7 +303,7 @@ int list_init(list_t *restrict l) { return 0; } -void list_destroy(list_t *restrict l) { +KS_DECLARE(void) list_destroy(list_t *restrict l) { unsigned int i; list_clear(l); @@ -389,19 +389,19 @@ int list_attributes_unserializer(list_t *restrict l, element_unserializer unseri return 0; } -int list_append(list_t *restrict l, const void *data) { +KS_DECLARE(int) list_append(list_t *restrict l, const void *data) { return list_insert_at(l, data, l->numels); } -int list_prepend(list_t *restrict l, const void *data) { +KS_DECLARE(int) list_prepend(list_t *restrict l, const void *data) { return list_insert_at(l, data, 0); } -void *list_fetch(list_t *restrict l) { +KS_DECLARE(void *) list_fetch(list_t *restrict l) { return list_extract_at(l, 0); } -void *list_get_at(const list_t *restrict l, unsigned int pos) { +KS_DECLARE(void *) list_get_at(const list_t *restrict l, unsigned int pos) { struct list_entry_s *tmp; tmp = list_findpos(l, pos); @@ -409,11 +409,11 @@ void *list_get_at(const list_t *restrict l, unsigned int pos) { return (tmp != NULL ? tmp->data : NULL); } -void *list_get_max(const list_t *restrict l) { +KS_DECLARE(void *) list_get_max(const list_t *restrict l) { return list_get_minmax(l, +1); } -void *list_get_min(const list_t *restrict l) { +KS_DECLARE(void *) list_get_min(const list_t *restrict l) { return list_get_minmax(l, -1); } @@ -465,7 +465,7 @@ static inline struct list_entry_s *list_findpos(const list_t *restrict l, int po return ptr; } -void *list_extract_at(list_t *restrict l, unsigned int pos) { +KS_DECLARE(void *) list_extract_at(list_t *restrict l, unsigned int pos) { struct list_entry_s *tmp; void *data; @@ -483,7 +483,7 @@ void *list_extract_at(list_t *restrict l, unsigned int pos) { return data; } -int list_insert_at(list_t *restrict l, const void *data, unsigned int pos) { +KS_DECLARE(int) list_insert_at(list_t *restrict l, const void *data, unsigned int pos) { struct list_entry_s *lent, *succ, *prec; if (l->iter_active || pos > l->numels) return -1; @@ -536,7 +536,7 @@ int list_insert_at(list_t *restrict l, const void *data, unsigned int pos) { return 1; } -int list_delete(list_t *restrict l, const void *data) { +KS_DECLARE(int) list_delete(list_t *restrict l, const void *data) { int pos, r; pos = list_locate(l, data); @@ -552,7 +552,7 @@ int list_delete(list_t *restrict l, const void *data) { return 0; } -int list_delete_at(list_t *restrict l, unsigned int pos) { +KS_DECLARE(int) list_delete_at(list_t *restrict l, unsigned int pos) { struct list_entry_s *delendo; @@ -570,7 +570,7 @@ int list_delete_at(list_t *restrict l, unsigned int pos) { return 0; } -int list_delete_range(list_t *restrict l, unsigned int posstart, unsigned int posend) { +KS_DECLARE(int) list_delete_range(list_t *restrict l, unsigned int posstart, unsigned int posend) { struct list_entry_s *lastvalid, *tmp, *tmp2; unsigned int numdel, midposafter, i; int movedx; @@ -637,7 +637,7 @@ int list_delete_range(list_t *restrict l, unsigned int posstart, unsigned int po return numdel; } -int list_clear(list_t *restrict l) { +KS_DECLARE(int) list_clear(list_t *restrict l) { struct list_entry_s *s; unsigned int numels; @@ -684,15 +684,15 @@ int list_clear(list_t *restrict l) { return numels; } -unsigned int list_size(const list_t *restrict l) { +KS_DECLARE(unsigned int) list_size(const list_t *restrict l) { return l->numels; } -int list_empty(const list_t *restrict l) { +KS_DECLARE(int) list_empty(const list_t *restrict l) { return (l->numels == 0); } -int list_locate(const list_t *restrict l, const void *data) { +KS_DECLARE(int) list_locate(const list_t *restrict l, const void *data) { struct list_entry_s *el; int pos = 0; @@ -713,7 +713,7 @@ int list_locate(const list_t *restrict l, const void *data) { return pos; } -void *list_seek(list_t *restrict l, const void *indicator) { +KS_DECLARE(void *) list_seek(list_t *restrict l, const void *indicator) { const struct list_entry_s *iter; if (l->attrs.seeker == NULL) return NULL; @@ -725,11 +725,11 @@ void *list_seek(list_t *restrict l, const void *indicator) { return NULL; } -int list_contains(const list_t *restrict l, const void *data) { +KS_DECLARE(int) list_contains(const list_t *restrict l, const void *data) { return (list_locate(l, data) >= 0); } -int list_concat(const list_t *l1, const list_t *l2, list_t *restrict dest) { +KS_DECLARE(int) list_concat(const list_t *l1, const list_t *l2, list_t *restrict dest) { struct list_entry_s *el, *srcel; unsigned int cnt; int err; @@ -783,7 +783,7 @@ int list_concat(const list_t *l1, const list_t *l2, list_t *restrict dest) { return 0; } -int list_sort(list_t *restrict l, int versus) { +KS_DECLARE(int) list_sort(list_t *restrict l, int versus) { if (l->iter_active || l->attrs.comparator == NULL) /* cannot modify list in the middle of an iteration */ return -1; @@ -960,7 +960,7 @@ static void list_sort_quicksort(list_t *restrict l, int versus, #endif } -int list_iterator_start(list_t *restrict l) { +KS_DECLARE(int) list_iterator_start(list_t *restrict l) { if (l->iter_active) return 0; l->iter_pos = 0; l->iter_active = 1; @@ -968,7 +968,7 @@ int list_iterator_start(list_t *restrict l) { return 1; } -void *list_iterator_next(list_t *restrict l) { +KS_DECLARE(void *) list_iterator_next(list_t *restrict l) { void *toret; if (!l->iter_active) return NULL; @@ -980,19 +980,19 @@ void *list_iterator_next(list_t *restrict l) { return toret; } -int list_iterator_hasnext(const list_t *restrict l) { +KS_DECLARE(int) list_iterator_hasnext(const list_t *restrict l) { if (!l->iter_active) return 0; return (l->iter_pos < l->numels); } -int list_iterator_stop(list_t *restrict l) { +KS_DECLARE(int) list_iterator_stop(list_t *restrict l) { if (!l->iter_active) return 0; l->iter_pos = 0; l->iter_active = 0; return 1; } -int list_hash(const list_t *restrict l, list_hash_t *restrict hash) { +KS_DECLARE(int) list_hash(const list_t *restrict l, list_hash_t *restrict hash) { struct list_entry_s *x; list_hash_t tmphash; diff --git a/libs/libks/test/test_thread_pools.vcxproj b/libs/libks/test/test_thread_pools.vcxproj index 5e488c5dff..974ab4fc20 100644 --- a/libs/libks/test/test_thread_pools.vcxproj +++ b/libs/libks/test/test_thread_pools.vcxproj @@ -181,9 +181,6 @@ {d331904d-a00a-4694-a5a3-fcff64ab5dbe} - - {25bd39b1-c8bf-4676-a738-9cabd9c6bc79} - {b4b62169-5ad4-4559-8707-3d933ac5db39} diff --git a/libs/libks/test/testacl.vcxproj b/libs/libks/test/testacl.vcxproj index ae3e3ddb35..ffed964941 100644 --- a/libs/libks/test/testacl.vcxproj +++ b/libs/libks/test/testacl.vcxproj @@ -181,9 +181,6 @@ {d331904d-a00a-4694-a5a3-fcff64ab5dbe} - - {25bd39b1-c8bf-4676-a738-9cabd9c6bc79} - {b4b62169-5ad4-4559-8707-3d933ac5db39} diff --git a/libs/libks/test/testwebsock.vcxproj b/libs/libks/test/testwebsock.vcxproj index 8648b71308..d3bbc3e9f2 100644 --- a/libs/libks/test/testwebsock.vcxproj +++ b/libs/libks/test/testwebsock.vcxproj @@ -181,9 +181,6 @@ {d331904d-a00a-4694-a5a3-fcff64ab5dbe} - - {25bd39b1-c8bf-4676-a738-9cabd9c6bc79} - {b4b62169-5ad4-4559-8707-3d933ac5db39} diff --git a/libs/win32/libconfig/libconfig.2015.vcxproj b/libs/win32/libconfig/libconfig.2015.vcxproj new file mode 100644 index 0000000000..e5ae0f3c89 --- /dev/null +++ b/libs/win32/libconfig/libconfig.2015.vcxproj @@ -0,0 +1,345 @@ + + + + + DebugDLL + Win32 + + + DebugDLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + ReleaseDLL + Win32 + + + ReleaseDLL + x64 + + + Release + Win32 + + + Release + x64 + + + + libconfig + {1A234565-926D-49B2-83E4-D56E0C38C9F2} + Win32Proj + libconfig + + + + StaticLibrary + true + MultiByte + false + v140 + + + DynamicLibrary + true + MultiByte + false + v140 + + + StaticLibrary + true + MultiByte + false + v140 + + + DynamicLibrary + true + MultiByte + false + v140 + + + StaticLibrary + false + true + MultiByte + v140 + + + DynamicLibrary + false + true + MultiByte + v140 + + + StaticLibrary + false + true + MultiByte + v140 + + + DynamicLibrary + false + true + MultiByte + v140 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + + + true + + + true + + + true + + + false + + + false + + + false + + + false + + + + + + Level3 + Disabled + WIN32;_DEBUG;%(PreprocessorDefinitions) + 4244;%(DisableSpecificWarnings) + MultiThreadedDebug + %(AdditionalIncludeDirectories) + /arch:AVX %(AdditionalOptions) + false + + + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;%(PreprocessorDefinitions) + 4244;%(DisableSpecificWarnings) + MultiThreadedDebugDLL + %(AdditionalIncludeDirectories) + /arch:AVX %(AdditionalOptions) + false + + + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;%(PreprocessorDefinitions) + 4244;%(DisableSpecificWarnings) + MultiThreadedDebug + /arch:AVX %(AdditionalOptions) + false + + + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;%(PreprocessorDefinitions) + 4244;%(DisableSpecificWarnings) + MultiThreadedDebugDLL + /arch:AVX %(AdditionalOptions) + false + + + Console + true + + + + + Level3 + + + Full + true + true + WIN32;NDEBUG;%(PreprocessorDefinitions) + 4244;%(DisableSpecificWarnings) + MultiThreaded + Speed + %(AdditionalIncludeDirectories) + false + /arch:AVX %(AdditionalOptions) + + + Console + true + true + true + + + + + Level3 + + + Full + true + true + WIN32;NDEBUG;%(PreprocessorDefinitions) + 4244;%(DisableSpecificWarnings) + MultiThreadedDLL + Speed + %(AdditionalIncludeDirectories) + false + /arch:AVX %(AdditionalOptions) + + + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;%(PreprocessorDefinitions) + 4244;%(DisableSpecificWarnings) + MultiThreaded + false + /arch:AVX %(AdditionalOptions) + + + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;%(PreprocessorDefinitions) + 4244;%(DisableSpecificWarnings) + MultiThreadedDLL + false + /arch:AVX %(AdditionalOptions) + + + Console + true + true + true + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/libs/win32/libconfig/libconfig.2015.vcxproj.filters b/libs/win32/libconfig/libconfig.2015.vcxproj.filters new file mode 100644 index 0000000000..e7b884e6c6 --- /dev/null +++ b/libs/win32/libconfig/libconfig.2015.vcxproj.filters @@ -0,0 +1,57 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + \ No newline at end of file diff --git a/libs/win32/libsodium/libsodium.2015.vcxproj b/libs/win32/libsodium/libsodium.2015.vcxproj new file mode 100644 index 0000000000..e12109e020 --- /dev/null +++ b/libs/win32/libsodium/libsodium.2015.vcxproj @@ -0,0 +1,556 @@ + + + + + DebugDLL + Win32 + + + DebugDLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + ReleaseDLL + Win32 + + + ReleaseDLL + x64 + + + Release + Win32 + + + Release + x64 + + + + libsodium + {A185B162-6CB6-4502-B03F-B56F7699A8D9} + Win32Proj + libsodium + + + + StaticLibrary + true + MultiByte + false + v140 + + + DynamicLibrary + true + MultiByte + false + v140 + + + StaticLibrary + true + MultiByte + false + v140 + + + DynamicLibrary + true + MultiByte + false + v140 + + + StaticLibrary + false + true + MultiByte + v140 + + + DynamicLibrary + false + true + MultiByte + v140 + + + StaticLibrary + false + true + MultiByte + v140 + + + DynamicLibrary + false + true + MultiByte + v140 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + + + true + + + true + + + true + + + false + + + false + + + false + + + false + + + + + + Level3 + Disabled + SODIUM_STATIC;SODIUM_EXPORT=;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + 4244;%(DisableSpecificWarnings) + MultiThreadedDebug + %(AdditionalIncludeDirectories) + /arch:AVX %(AdditionalOptions) + false + + + Console + true + + + + + + + Level3 + Disabled + SODIUM_EXPORT=__declspec(dllexport);SODIUM_DLL_EXPORT;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + 4244;%(DisableSpecificWarnings) + MultiThreadedDebugDLL + %(AdditionalIncludeDirectories) + /arch:AVX %(AdditionalOptions) + false + + + Console + true + + + + + + + Level3 + Disabled + SODIUM_STATIC;SODIUM_EXPORT=;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + 4244;%(DisableSpecificWarnings) + MultiThreadedDebug + /arch:AVX %(AdditionalOptions) + false + + + Console + true + + + + + + + Level3 + Disabled + SODIUM_EXPORT=__declspec(dllexport);SODIUM_DLL_EXPORT;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + 4244;%(DisableSpecificWarnings) + MultiThreadedDebugDLL + /arch:AVX %(AdditionalOptions) + false + + + Console + true + + + + + Level3 + + + Full + true + true + SODIUM_STATIC;SODIUM_EXPORT=;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + 4244;%(DisableSpecificWarnings) + MultiThreaded + Speed + %(AdditionalIncludeDirectories) + false + /arch:AVX %(AdditionalOptions) + + + Console + true + true + true + + + + + Level3 + + + Full + true + true + SODIUM_EXPORT=__declspec(dllexport);SODIUM_DLL_EXPORT;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + 4244;%(DisableSpecificWarnings) + MultiThreadedDLL + Speed + %(AdditionalIncludeDirectories) + false + /arch:AVX %(AdditionalOptions) + + + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + SODIUM_STATIC;SODIUM_EXPORT=;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + 4244;%(DisableSpecificWarnings) + MultiThreaded + false + /arch:AVX %(AdditionalOptions) + + + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + SODIUM_EXPORT=__declspec(dllexport);SODIUM_DLL_EXPORT;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + 4244;%(DisableSpecificWarnings) + MultiThreadedDLL + false + /arch:AVX %(AdditionalOptions) + + + Console + true + true + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/libs/win32/libsodium/libsodium.2015.vcxproj.filters b/libs/win32/libsodium/libsodium.2015.vcxproj.filters new file mode 100644 index 0000000000..6998b0846f --- /dev/null +++ b/libs/win32/libsodium/libsodium.2015.vcxproj.filters @@ -0,0 +1,690 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + \ No newline at end of file