fix windows/msvc build

master
Bill 2 years ago
parent 64b2ec4d8f
commit 1d1b392435

@ -52,7 +52,7 @@ int gen_trade_data(int argc, char* argv[])
printf("No parameter supplied. Use default frac=%f, N=%d? [Y/n]\n", frac, N);
char buf[4096]; fgets(buf, 4095, stdin);
if((buf[0] != 'y' && buf[0] !='Y') && buf[0] != '\n') {
const auto &getParams = [&](){ puts("Type: frac N [ENTER]");
const auto &getParams = [&](){ puts("Type: frac N n_rows [ENTER]");
for(int i = 0; i < 4096; ++i) if(buf[i] == '\n') {buf[i] = 0; break;}
char* _buf = buf; frac = getFloat(_buf); N = getInt(_buf); n_rows=getInt(_buf);
}; getParams();
@ -102,7 +102,7 @@ int gen_trade_data(int argc, char* argv[])
current_price = new_price;
}
d[i]= {ss, i+1, (int)g_quantity(engine), current_price};
fprintf(fp, "s%d, %d, %d, %d\n", d[i].ss, d[i].t, d[i].q, d[i].p);
fprintf(fp, "%d, %d, %d, %d\n", d[i].ss, d[i].t, d[i].q, d[i].p);
last_price[ss - 1] = current_price;
}
fclose(fp);
@ -148,8 +148,9 @@ int gen_stock_data(int argc, char* argv[]){
fprintf(fp, "%s,%s\n", IDs[i].c_str(), names[i].c_str());
}
fclose(fp);
return 0;
}
int main(int argc, char* argv[]){
return gen_stock_data(argc, argv);
return gen_trade_data(argc, argv);
}

@ -130,7 +130,7 @@
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>QUERY_DECLSPEC=__declspec(dllexport);_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<LanguageStandard>stdcpplatest</LanguageStandard>
<LanguageStandard_C>stdc17</LanguageStandard_C>
@ -156,7 +156,7 @@
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>false</SDLCheck>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>QUERY_DECLSPEC=__declspec(dllexport);_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<LanguageStandard>stdcpplatest</LanguageStandard>
<LanguageStandard_C>stdc17</LanguageStandard_C>
@ -197,7 +197,7 @@
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>false</SDLCheck>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>QUERY_DECLSPEC=__declspec(dllexport);_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<LanguageStandard>stdcpplatest</LanguageStandard>
<LanguageStandard_C>stdc17</LanguageStandard_C>
@ -236,7 +236,7 @@
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>QUERY_DECLSPEC=__declspec(dllexport);_CRT_SECURE_NO_WARNINGS;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<LanguageStandard>stdcpplatest</LanguageStandard>
<LanguageStandard_C>stdc17</LanguageStandard_C>
@ -266,7 +266,7 @@
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>false</SDLCheck>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>QUERY_DECLSPEC=__declspec(dllexport);_CRT_SECURE_NO_WARNINGS;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<LanguageStandard>stdcpplatest</LanguageStandard>
<LanguageStandard_C>stdc17</LanguageStandard_C>
@ -307,7 +307,7 @@
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>false</SDLCheck>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>QUERY_DECLSPEC=__declspec(dllexport);_CRT_SECURE_NO_WARNINGS;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<LanguageStandard>stdcpplatest</LanguageStandard>
<LanguageStandard_C>stdc17</LanguageStandard_C>

@ -134,7 +134,7 @@
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>QUERY_DECLSPEC=__declspec(dllimport);_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<LanguageStandard>stdcpplatest</LanguageStandard>
<ControlFlowGuard>Guard</ControlFlowGuard>
@ -166,7 +166,7 @@
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>false</SDLCheck>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>QUERY_DECLSPEC=__declspec(dllimport);_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<LanguageStandard>stdcpplatest</LanguageStandard>
<AdditionalIncludeDirectories>$(ProjectDir)\..\monetdb\msvc</AdditionalIncludeDirectories>
@ -209,7 +209,7 @@
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>false</SDLCheck>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>QUERY_DECLSPEC=__declspec(dllimport);_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<LanguageStandard>stdcpplatest</LanguageStandard>
<AdditionalIncludeDirectories>$(ProjectDir)\..\monetdb\msvc</AdditionalIncludeDirectories>
@ -250,7 +250,7 @@
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_ALLOW_RTCc_IN_STL;_CRT_SECURE_NO_WARNINGS;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>QUERY_DECLSPEC=__declspec(dllimport);_ALLOW_RTCc_IN_STL;_CRT_SECURE_NO_WARNINGS;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<LanguageStandard>stdcpplatest</LanguageStandard>
<ControlFlowGuard>false</ControlFlowGuard>
@ -300,7 +300,7 @@
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>false</SDLCheck>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>QUERY_DECLSPEC=__declspec(dllimport);_CRT_SECURE_NO_WARNINGS;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<LanguageStandard>stdcpplatest</LanguageStandard>
<AdditionalIncludeDirectories>$(ProjectDir)\..\monetdb\msvc</AdditionalIncludeDirectories>
@ -343,7 +343,7 @@
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>false</SDLCheck>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>QUERY_DECLSPEC=__declspec(dllimport);_CRT_SECURE_NO_WARNINGS;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<LanguageStandard>stdcpplatest</LanguageStandard>
<AdditionalIncludeDirectories>$(ProjectDir)\..\monetdb\msvc</AdditionalIncludeDirectories>

@ -24,6 +24,10 @@ EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testmain", "testmain.vcxproj", "{73BD0DDA-7E66-4318-B46B-B8207AFA6355}"
ProjectSection(ProjectDependencies) = postProject
{8081FDAA-4D13-4B7A-ADB2-8224AF7F1C81} = {8081FDAA-4D13-4B7A-ADB2-8224AF7F1C81}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "datagen", "datagen\datagen.vcxproj", "{5AA4E63C-CFF8-467C-8872-84206CEDE7A9}"
ProjectSection(ProjectDependencies) = postProject
{B52AACF7-16A6-4FCA-90AD-867D367BDA4F} = {B52AACF7-16A6-4FCA-90AD-867D367BDA4F}
EndProjectSection
EndProject
@ -169,6 +173,26 @@ Global
{73BD0DDA-7E66-4318-B46B-B8207AFA6355}.sharedlib|x64.Build.0 = sharedlib|x64
{73BD0DDA-7E66-4318-B46B-B8207AFA6355}.sharedlib|x86.ActiveCfg = sharedlib|Win32
{73BD0DDA-7E66-4318-B46B-B8207AFA6355}.sharedlib|x86.Build.0 = sharedlib|Win32
{5AA4E63C-CFF8-467C-8872-84206CEDE7A9}.Debug|x64.ActiveCfg = Debug|x64
{5AA4E63C-CFF8-467C-8872-84206CEDE7A9}.Debug|x64.Build.0 = Debug|x64
{5AA4E63C-CFF8-467C-8872-84206CEDE7A9}.Debug|x86.ActiveCfg = Debug|Win32
{5AA4E63C-CFF8-467C-8872-84206CEDE7A9}.Debug|x86.Build.0 = Debug|Win32
{5AA4E63C-CFF8-467C-8872-84206CEDE7A9}.Release|x64.ActiveCfg = Release|x64
{5AA4E63C-CFF8-467C-8872-84206CEDE7A9}.Release|x64.Build.0 = Release|x64
{5AA4E63C-CFF8-467C-8872-84206CEDE7A9}.Release|x86.ActiveCfg = Release|Win32
{5AA4E63C-CFF8-467C-8872-84206CEDE7A9}.Release|x86.Build.0 = Release|Win32
{5AA4E63C-CFF8-467C-8872-84206CEDE7A9}.RelWDbgInf|x64.ActiveCfg = Release|x64
{5AA4E63C-CFF8-467C-8872-84206CEDE7A9}.RelWDbgInf|x64.Build.0 = Release|x64
{5AA4E63C-CFF8-467C-8872-84206CEDE7A9}.RelWDbgInf|x86.ActiveCfg = Release|Win32
{5AA4E63C-CFF8-467C-8872-84206CEDE7A9}.RelWDbgInf|x86.Build.0 = Release|Win32
{5AA4E63C-CFF8-467C-8872-84206CEDE7A9}.shared|x64.ActiveCfg = Debug|x64
{5AA4E63C-CFF8-467C-8872-84206CEDE7A9}.shared|x64.Build.0 = Debug|x64
{5AA4E63C-CFF8-467C-8872-84206CEDE7A9}.shared|x86.ActiveCfg = Debug|Win32
{5AA4E63C-CFF8-467C-8872-84206CEDE7A9}.shared|x86.Build.0 = Debug|Win32
{5AA4E63C-CFF8-467C-8872-84206CEDE7A9}.sharedlib|x64.ActiveCfg = Debug|x64
{5AA4E63C-CFF8-467C-8872-84206CEDE7A9}.sharedlib|x64.Build.0 = Debug|x64
{5AA4E63C-CFF8-467C-8872-84206CEDE7A9}.sharedlib|x86.ActiveCfg = Debug|Win32
{5AA4E63C-CFF8-467C-8872-84206CEDE7A9}.sharedlib|x86.Build.0 = Debug|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

@ -219,6 +219,7 @@
<AdditionalDependencies>..\libaquery.lib;$(ProjectDir)\..\monetdb\msvc\monetdbe.lib;%(AdditionalDependencies)</AdditionalDependencies>
<DataExecutionPrevention>false</DataExecutionPrevention>
<AdditionalOptions>/WHOLEARCHIVE:libaquery.lib %(AdditionalOptions)</AdditionalOptions>
<Profile>true</Profile>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='RelWDbgInf|Win32'">
@ -319,6 +320,7 @@
<AdditionalDependencies>..\libaquery.lib;$(ProjectDir)\..\monetdb\msvc\monetdbe.lib;%(AdditionalDependencies)</AdditionalDependencies>
<DataExecutionPrevention>false</DataExecutionPrevention>
<AdditionalOptions>/WHOLEARCHIVE:libaquery.lib %(AdditionalOptions)</AdditionalOptions>
<Profile>true</Profile>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='RelWDbgInf|x64'">

@ -4,3 +4,4 @@
#define Ops(o) template<typename T> vector_type<typename types::Coercion<_Ty, T>::type> operator##o(const vector_type<T>& r) { [[likely]] if (r.size == size) { return add(r); } else if (r.size == 1 || size == 1) { const bool lr = size == 1; const uint32_t& _size = lr ? r.size : size; const auto& _container = lr ? r.container : container; const auto& scalar = *(lr ? container : r.container); vector_type<typename types::Coercion<_Ty, T>::type> ret(_size); for (int i = 0; i < _size; ++i) ret[i] = _container[i] o scalar; return ret; } }
#define Op(o, x) template<typename T> vector_type<typename types::Coercion<_Ty, T>::type> inline x(const vector_type<T>& r) { vector_type<typename types::Coercion<_Ty, T>::type> ret(size); for (int i = 0; i < size; ++i) ret[i] = container[i] o r[i]; return ret; }
#define _Make_Ops(M) M(+, add) M(-, minus) M(*, multi) M(/, div) M(%, mod) M(&, and) M(|, or) M(^, xor)
#define QUERY_DECLSPEC

@ -1,7 +1,10 @@
#pragma once
#include <atomic>
#ifndef QUERY_DECLSPEC
#define QUERY_DECLSPEC
#endif
class ScratchSpace {
class QUERY_DECLSPEC ScratchSpace {
public:
void* ret;
char* scratchspace;
@ -10,7 +13,7 @@ public:
size_t capacity;
size_t initial_capacity;
void* temp_memory_fractions;
//uint8_t status;
// record maximum size
constexpr static uint8_t Grow = 0x1;
@ -36,7 +39,7 @@ public:
#ifndef __AQ_USE_THREADEDGC__
class GC {
class QUERY_DECLSPEC GC {
private:
size_t max_slots,
interval, forced_clean,

@ -96,6 +96,9 @@
# define ANKERL_UNORDERED_DENSE_UNLIKELY(x) (x) // NOLINT(cppcoreguidelines-macro-usage)
# endif
template<class Key, class Hash>
class AQHashTable;
namespace ankerl::unordered_dense {
inline namespace ANKERL_UNORDERED_DENSE_NAMESPACE {
@ -418,6 +421,7 @@ public:
using iterator = typename value_container_type::iterator;
using const_iterator = typename value_container_type::const_iterator;
using bucket_type = Bucket;
friend class AQHashTable<Key, Hash>;
private:
using value_idx_type = decltype(Bucket::m_value_idx);

@ -474,6 +474,7 @@ public:
explicit AQHashTable(uint32_t sz)
: ankerl::unordered_dense::set<Key, Hash>{} {
this->reserve(sz);
this->m_values.reserve(sz);
reversemap = static_cast<uint32_t *>(malloc(sizeof(uint32_t) * sz * 2));
mapbase = reversemap + sz;
ht_base = static_cast<uint32_t *>(calloc(sz, sizeof(uint32_t)));

Loading…
Cancel
Save