diff --git a/msc-plugin/testmain.vcxproj b/msc-plugin/testmain.vcxproj index 5b1571a..353cb78 100644 --- a/msc-plugin/testmain.vcxproj +++ b/msc-plugin/testmain.vcxproj @@ -27,7 +27,7 @@ - + 16.0 diff --git a/server/hasher.h b/server/hasher.h index 70a97e8..43608ab 100644 --- a/server/hasher.h +++ b/server/hasher.h @@ -5,14 +5,16 @@ #include #include "types.h" // only works for 64 bit systems -constexpr size_t _FNV_offset_basis = 14695981039346656037ULL; -constexpr size_t _FNV_prime = 1099511628211ULL; +namespace hasher_consts{ + constexpr size_t _FNV_offset_basis = 14695981039346656037ULL; + constexpr size_t _FNV_prime = 1099511628211ULL; +} inline size_t append_bytes(const unsigned char* _First) noexcept { - size_t _Val = _FNV_offset_basis; + size_t _Val = hasher_consts::_FNV_offset_basis; for (; *_First; ++_First) { _Val ^= static_cast(*_First); - _Val *= _FNV_prime; + _Val *= hasher_consts::_FNV_prime; } return _Val; diff --git a/server/jeaiii_to_text.h b/server/jeaiii_to_text.h index 63fd9ee..d364108 100644 --- a/server/jeaiii_to_text.h +++ b/server/jeaiii_to_text.h @@ -82,7 +82,7 @@ inline char* to_text(char text[], unsigned long long i) { return to_text_from_in // Copyright (c) 2022 Bill Sun -//#if defined(SIZEOF___INT128) || (defined(SIZEOF___INT128_T) && defined(SIZEOF___UINT128_T)) +#if defined(__SIZEOF_INT128__) constexpr static __uint128_t _10_19 = 10000000000000000000ull, _10_37 = _10_19*_10_19 / 10; @@ -118,4 +118,4 @@ char* jeaiii_i128(char* buf, T v){ buf = to_text(buf, uint64_t(v % _10_19)); return buf; } -// #endif +#endif // INT128 diff --git a/server/libaquery.h b/server/libaquery.h index cc0b5a9..a6c6a08 100644 --- a/server/libaquery.h +++ b/server/libaquery.h @@ -153,4 +153,5 @@ template<> char* aq_to_chars(void* , char*); template<> char* aq_to_chars(void* , char*); template<> char* aq_to_chars(void* , char*); template<> char* aq_to_chars(void* , char*); +typedef int (*code_snippet)(void*); #endif diff --git a/server/monetdb_conn.cpp b/server/monetdb_conn.cpp index b3fbd1e..a7827ae 100644 --- a/server/monetdb_conn.cpp +++ b/server/monetdb_conn.cpp @@ -6,7 +6,7 @@ #include "monetdb_conn.h" #include "monetdbe.h" #include "table.h" - +#undef ERROR #undef static_assert constexpr const char* monetdbe_type_str[] = { diff --git a/server/server.cpp b/server/server.cpp index 913ee4c..dc6290e 100644 --- a/server/server.cpp +++ b/server/server.cpp @@ -117,7 +117,6 @@ A_Semaphore prompt{ true }, engine{ false }; #define ENGINE_RELEASE() #endif -typedef int (*code_snippet)(void*); typedef void (*module_init_fn)(Context*); @@ -179,6 +178,8 @@ constexpr prt_fn_t monetdbe_prtfns[] = { }; #include "monetdbe.h" +#undef max +#undef min inline constexpr static unsigned char monetdbe_type_szs[] = { sizeof(monetdbe_column_bool::null_value), sizeof(monetdbe_column_int8_t::null_value), sizeof(monetdbe_column_int16_t::null_value), sizeof(monetdbe_column_int32_t::null_value), @@ -437,7 +438,7 @@ int launcher(int argc, char** argv){ str = std::string("cd ") + pwd + std::string("&& python3 ./prompt.py ") + str; return system(str.c_str()); } - +#if !( defined(_MSC_VER) && defined(_DEBUG) ) extern "C" int __DLLEXPORT__ main(int argc, char** argv) { #ifdef __AQ_BUILD_LAUNCHER__ return launcher(argc, argv); @@ -490,3 +491,4 @@ extern "C" int __DLLEXPORT__ main(int argc, char** argv) { return 0; } +#endif // MSCDBG \ No newline at end of file diff --git a/server/table.h b/server/table.h index 1646088..fb78189 100644 --- a/server/table.h +++ b/server/table.h @@ -24,7 +24,7 @@ namespace types { enum Type_t; template struct Types; - template + template struct Coercion; } #endif diff --git a/server/winhelper.h b/server/winhelper.h index f39c0b9..463c8bc 100644 --- a/server/winhelper.h +++ b/server/winhelper.h @@ -1,7 +1,8 @@ #ifndef _WINHELPER_H #define _WINHELPER_H + #ifdef _WIN32 -static constexpr int RTLD_LAZY = 1; +static constexpr int RTLD_LAZY = 1, RTLD_NOW = 1; void* dlopen(const char*, int); void* dlsym(void*, const char*); int dlclose(void*); @@ -20,11 +21,13 @@ class A_Semaphore { private: void* native_handle; public: - A_Semaphore(); + A_Semaphore(bool); void acquire(); void release(); ~A_Semaphore(); }; #endif -#endif +#endif // WIN32 + +#endif // WINHELPER