Skip to content

Commit

Permalink
New era
Browse files Browse the repository at this point in the history
  • Loading branch information
alesapin committed Oct 1, 2024
1 parent e0f6b48 commit 6ba60ac
Show file tree
Hide file tree
Showing 16 changed files with 231 additions and 207 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ option (CH_ODBC_ALLOW_UNSAFE_DISPATCH "Allow unchecked handle dispatching (may s
option (CH_ODBC_ENABLE_SSL "Enable SSL (required for utilizing https:// interface, etc.)" ON)
option (CH_ODBC_ENABLE_INSTALL "Enable install targets (required for packaging)" ON)
cmake_dependent_option (CH_ODBC_ENABLE_TESTING "Enable test targets" ON "BUILD_TESTING" OFF)
option (CH_ODBC_USE_ICU "Use ICU library, instead of C++ STD, for Unicode conversions" ON)
cmake_dependent_option (CH_ODBC_USE_ICU "Use ICU library, instead of C++ STD, for Unicode conversions" ON "NOT MSVC" OFF)
option (CH_ODBC_PREFER_BUNDLED_THIRD_PARTIES "Prefer bundled over system variants of third party libraries" ON)
cmake_dependent_option (CH_ODBC_PREFER_BUNDLED_POCO "Prefer bundled over system variants of Poco library" ON "CH_ODBC_PREFER_BUNDLED_THIRD_PARTIES" OFF)
cmake_dependent_option (CH_ODBC_PREFER_BUNDLED_SSL "Prefer bundled over system variants of SSL library" ON "CH_ODBC_PREFER_BUNDLED_POCO" OFF)
Expand Down
5 changes: 2 additions & 3 deletions contrib/icu-cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
if (OS_LINUX OR OS_DARWIN OR OS_WINDOWS)
if (OS_LINUX OR OS_DARWIN)
option(ENABLE_ICU "Enable ICU" 1)
else ()
option(ENABLE_ICU "Enable ICU" 0)
Expand Down Expand Up @@ -462,7 +462,7 @@ enable_language(ASM)
if (ARCH_S390X)
set(ICUDATA_SOURCE_FILE "${ICUDATA_SOURCE_DIR}/icudt75b_dat.S" )
else()
if (OS_LINUX)
if (OS_LINUX OR OS_WINDOWS)
set(ICUDATA_SOURCE_FILE "${ICUDATA_SOURCE_DIR}/icudt75l_dat.S" )
elseif (OS_DARWIN)
if (ARCH_AARCH64)
Expand All @@ -483,7 +483,6 @@ if (OS_LINUX OR OS_DARWIN)
add_definitions(-D_REENTRANT -DU_HAVE_ELF_H=1 -DU_HAVE_STRTOD_L=1 -DU_HAVE_XLOCALE_H=0 -DDEFAULT_ICU_PLUGINS="/dev/null")
elseif (OS_WINDOWS)
add_definitions(-D_REENTRANT -DDEFAULT_ICU_PLUGINS="/dev/null")

endif()

add_library(_icuuc ${ICUUC_SOURCES})
Expand Down
41 changes: 21 additions & 20 deletions contrib/poco/Crypto/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,27 @@ if (ENABLE_SSL)

add_library (_poco_crypto ${SRCS})
add_library (Poco::Crypto ALIAS _poco_crypto)

# TODO: remove these warning exclusions
target_compile_options (_poco_crypto
PRIVATE
-Wno-covered-switch-default
-Wno-deprecated-dynamic-exception-spec
-Wno-extra-semi-stmt
-Wno-missing-noreturn
-Wno-newline-eof
-Wno-old-style-cast
-Wno-shadow
-Wno-shorten-64-to-32
-Wno-sign-compare
-Wno-suggest-destructor-override
-Wno-suggest-override
-Wno-unreachable-code-return
-Wno-unused-parameter
-Wno-zero-as-null-pointer-constant
-Wno-used-but-marked-unused
)
if (NOT MSVC)
# TODO: remove these warning exclusions
target_compile_options (_poco_crypto
PRIVATE
-Wno-covered-switch-default
-Wno-deprecated-dynamic-exception-spec
-Wno-extra-semi-stmt
-Wno-missing-noreturn
-Wno-newline-eof
-Wno-old-style-cast
-Wno-shadow
-Wno-shorten-64-to-32
-Wno-sign-compare
-Wno-suggest-destructor-override
-Wno-suggest-override
-Wno-unreachable-code-return
-Wno-unused-parameter
-Wno-zero-as-null-pointer-constant
-Wno-used-but-marked-unused
)
endif()
target_include_directories (_poco_crypto SYSTEM PUBLIC "include")
target_link_libraries (_poco_crypto PUBLIC Poco::Foundation OpenSSL::SSL OpenSSL::Crypto)

Expand Down
28 changes: 15 additions & 13 deletions contrib/poco/Data/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,20 @@ file (GLOB SRCS src/*.cpp)
add_library (_poco_data ${SRCS})
add_library (Poco::Data ALIAS _poco_data)

# TODO: remove these warning exclusions
target_compile_options (_poco_data
PRIVATE
-Wno-comma
-Wno-covered-switch-default
-Wno-deprecated-dynamic-exception-spec
-Wno-extra-semi-stmt
-Wno-old-style-cast
-Wno-shorten-64-to-32
-Wno-sign-compare
-Wno-unused-parameter
-Wno-zero-as-null-pointer-constant
)
if (NOT MSVC)
# TODO: remove these warning exclusions
target_compile_options (_poco_data
PRIVATE
-Wno-comma
-Wno-covered-switch-default
-Wno-deprecated-dynamic-exception-spec
-Wno-extra-semi-stmt
-Wno-old-style-cast
-Wno-shorten-64-to-32
-Wno-sign-compare
-Wno-unused-parameter
-Wno-zero-as-null-pointer-constant
)
endif()
target_include_directories (_poco_data SYSTEM PUBLIC "include")
target_link_libraries (_poco_data PUBLIC Poco::Foundation)
31 changes: 16 additions & 15 deletions contrib/poco/Data/ODBC/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,22 @@ if (ENABLE_ODBC)

add_library (_poco_data_odbc ${SRCS})
add_library (Poco::Data::ODBC ALIAS _poco_data_odbc)

# TODO: remove these warning exclusions
target_compile_options (_poco_data_odbc
PRIVATE
-Wno-cast-qual
-Wno-deprecated-dynamic-exception-spec
-Wno-extra-semi-stmt
-Wno-old-style-cast
-Wno-sign-compare
-Wno-tautological-constant-out-of-range-compare
-Wno-tautological-unsigned-zero-compare
-Wno-unused-parameter
-Wno-unused-variable
-Wno-zero-as-null-pointer-constant
)
if (NOT MSVC)
# TODO: remove these warning exclusions
target_compile_options (_poco_data_odbc
PRIVATE
-Wno-cast-qual
-Wno-deprecated-dynamic-exception-spec
-Wno-extra-semi-stmt
-Wno-old-style-cast
-Wno-sign-compare
-Wno-tautological-constant-out-of-range-compare
-Wno-tautological-unsigned-zero-compare
-Wno-unused-parameter
-Wno-unused-variable
-Wno-zero-as-null-pointer-constant
)
endif()
target_include_directories (_poco_data_odbc SYSTEM PUBLIC "include")
if (OS_LINUX OR OS_DARWIN)
target_link_libraries (_poco_data_odbc PUBLIC Poco::Data ch_contrib::unixodbc)
Expand Down
8 changes: 4 additions & 4 deletions contrib/poco/Data/ODBC/src/Extractor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ bool Extractor::extractManualImpl<std::string>(std::size_t pos, std::string& val
if (totalSize <= maxSize)
val.append(pChar, fetchedSize);
else
throw DataException(format(FLD_SIZE_EXCEEDED_FMT, fetchedSize, maxSize));
throw DataException(Poco::format(FLD_SIZE_EXCEEDED_FMT, fetchedSize, maxSize));
}while (true);

return true;
Expand Down Expand Up @@ -342,7 +342,7 @@ bool Extractor::extractManualImpl<UTF16String>(std::size_t pos, UTF16String& val
if (totalSize <= maxSize)
val.append(pChar, fetchedSize / sizeof(UTF16Char));
else
throw DataException(format(FLD_SIZE_EXCEEDED_FMT, fetchedSize, maxSize));
throw DataException(Poco::format(FLD_SIZE_EXCEEDED_FMT, fetchedSize, maxSize));
} while (true);

return true;
Expand Down Expand Up @@ -397,7 +397,7 @@ bool Extractor::extractManualImpl<Poco::Data::CLOB>(std::size_t pos,
if (totalSize <= maxSize)
val.appendRaw(pChar, fetchedSize);
else
throw DataException(format(FLD_SIZE_EXCEEDED_FMT, fetchedSize, maxSize));
throw DataException(Poco::format(FLD_SIZE_EXCEEDED_FMT, fetchedSize, maxSize));

}while (true);

Expand Down Expand Up @@ -1305,7 +1305,7 @@ void Extractor::checkDataSize(std::size_t size)
{
std::size_t maxSize = _pPreparator->getMaxFieldSize();
if (size > maxSize)
throw DataException(format(FLD_SIZE_EXCEEDED_FMT, size, maxSize));
throw DataException(Poco::format(FLD_SIZE_EXCEEDED_FMT, size, maxSize));
}


Expand Down
101 changes: 53 additions & 48 deletions contrib/poco/Foundation/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,23 @@ add_library (_poco_foundation_pcre ${SRCS_PCRE})
add_library (Poco::Foundation::PCRE ALIAS _poco_foundation_pcre)

# TODO: remove these warning exclusions
target_compile_options (_poco_foundation_pcre
PRIVATE
-Wno-cast-align
-Wno-cast-qual
-Wno-comma
-Wno-conditional-uninitialized
-Wno-extra-semi-stmt
-Wno-implicit-fallthrough
-Wno-reserved-identifier
-Wno-sign-compare
-Wno-unknown-pragmas
-Wno-unreachable-code-break
-Wno-unused-macros
)
if (NOT MSVC)
target_compile_options (_poco_foundation_pcre
PRIVATE
-Wno-cast-align
-Wno-cast-qual
-Wno-comma
-Wno-conditional-uninitialized
-Wno-extra-semi-stmt
-Wno-implicit-fallthrough
-Wno-reserved-identifier
-Wno-sign-compare
-Wno-unknown-pragmas
-Wno-unreachable-code-break
-Wno-unused-macros
)
endif()

set(SRCS
src/ASCIIEncoding.cpp
src/AbstractObserver.cpp
Expand Down Expand Up @@ -64,7 +67,7 @@ src/ErrorHandler.cpp
src/Event.cpp
src/EventArgs.cpp
src/EventChannel.cpp
#src/EventLogChannel.cpp
src/EventLogChannel.cpp
#src/Event_POSIX.cpp
#src/Event_VX.cpp
#src/Event_WIN32.cpp
Expand Down Expand Up @@ -271,39 +274,41 @@ elseif(OS_WINDOWS)
target_compile_definitions (_poco_foundation PUBLIC POCO_OS_FAMILY_WINDOWS Foundation_EXPORTS)
endif()

target_compile_options (_poco_foundation
PRIVATE
-Wno-array-bounds
-Wno-atomic-implicit-seq-cst
-Wno-cast-align
-Wno-cast-qual
-Wno-class-varargs
-Wno-covered-switch-default
-Wno-deprecated
-Wno-extra-semi-stmt
-Wno-implicit-fallthrough
-Wno-implicit-int-float-conversion
-Wno-misleading-indentation
-Wno-missing-noreturn
-Wno-old-style-cast
-Wno-redundant-parens
-Wno-reserved-identifier
-Wno-reserved-macro-identifier
-Wno-shadow
-Wno-shorten-64-to-32
-Wno-sign-compare
-Wno-suggest-destructor-override
-Wno-suggest-override
-Wno-tautological-unsigned-zero-compare
-Wno-thread-safety-analysis
-Wno-thread-safety-negative
-Wno-undef
-Wno-unreachable-code-return
-Wno-unused-exception-parameter
-Wno-unused-macros
-Wno-unused-parameter
-Wno-zero-as-null-pointer-constant
)
if (NOT MSVC)
target_compile_options (_poco_foundation
PRIVATE
-Wno-array-bounds
-Wno-atomic-implicit-seq-cst
-Wno-cast-align
-Wno-cast-qual
-Wno-class-varargs
-Wno-covered-switch-default
-Wno-deprecated
-Wno-extra-semi-stmt
-Wno-implicit-fallthrough
-Wno-implicit-int-float-conversion
-Wno-misleading-indentation
-Wno-missing-noreturn
-Wno-old-style-cast
-Wno-redundant-parens
-Wno-reserved-identifier
-Wno-reserved-macro-identifier
-Wno-shadow
-Wno-shorten-64-to-32
-Wno-sign-compare
-Wno-suggest-destructor-override
-Wno-suggest-override
-Wno-tautological-unsigned-zero-compare
-Wno-thread-safety-analysis
-Wno-thread-safety-negative
-Wno-undef
-Wno-unreachable-code-return
-Wno-unused-exception-parameter
-Wno-unused-macros
-Wno-unused-parameter
-Wno-zero-as-null-pointer-constant
)
endif()

add_definitions( -DPCRE_STATIC)

Expand Down
19 changes: 9 additions & 10 deletions contrib/poco/Foundation/src/EventLogChannel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#include "Poco/EventLogChannel.h"
#include "Poco/Message.h"
#include "Poco/String.h"
#include "pocomsg.h"
#if defined(POCO_WIN32_UTF8)
#include "Poco/UnicodeConverter.h"
#endif
Expand Down Expand Up @@ -120,7 +119,7 @@ void EventLogChannel::log(const Message& msg)
std::wstring utext;
UnicodeConverter::toUTF16(msg.getText(), utext);
const wchar_t* pMsg = utext.c_str();
ReportEventW(_h, getType(msg), getCategory(msg), POCO_MSG_LOG, NULL, 1, 0, &pMsg, NULL);
ReportEventW(_h, getType(msg), getCategory(msg), 0x1000, NULL, 1, 0, &pMsg, NULL);
#else
const char* pMsg = msg.getText().c_str();
ReportEvent(_h, getType(msg), getCategory(msg), POCO_MSG_LOG, NULL, 1, 0, &pMsg, NULL);
Expand Down Expand Up @@ -180,21 +179,21 @@ int EventLogChannel::getCategory(const Message& msg)
switch (msg.getPriority())
{
case Message::PRIO_TRACE:
return POCO_CTG_TRACE;
return 0x8;
case Message::PRIO_DEBUG:
return POCO_CTG_DEBUG;
return 0x7;
case Message::PRIO_INFORMATION:
return POCO_CTG_INFORMATION;
return 0x6;
case Message::PRIO_NOTICE:
return POCO_CTG_NOTICE;
return 0x5;
case Message::PRIO_WARNING:
return POCO_CTG_WARNING;
return 0x4;
case Message::PRIO_ERROR:
return POCO_CTG_ERROR;
return 0x3;
case Message::PRIO_CRITICAL:
return POCO_CTG_CRITICAL;
return 0x2;
case Message::PRIO_FATAL:
return POCO_CTG_FATAL;
return 0x1;
default:
return 0;
}
Expand Down
Loading

0 comments on commit 6ba60ac

Please sign in to comment.