Use "_s" versions of the standard C functions if possible/simple to do
and disable deprecation warnings explicitly in a couple of places where
this could not be done instead of disabling them globally.
Also stop using strcpy() entirely and use strncpy() instead.
See #1268.
They were ugly and not really necessary when we can just avoid marking
the functions as deprecated when compiling SOCI itself to allow using
them from the implementation code.
Also simply remove deprecated attributes from the functions in
blob_backend which is not supposed to be used publicly at all.
This was accidentally broken by 0558c146 (Don't bother checking for
Threads when using MSVC, 2025-06-07), move this part of
target_link_libraries() outside the "NOT MSVC" check added there.
Keep SOCI_NORETURN defined just in case somebody uses it in their own
code, but stop using it in SOCI and just use the standard C++11
attribute directly instead.
Revert both 97323979 (Do not include stdint.h when compiling with Visual
C++, 2009-10-11) and 00cdf153 (Added missing include., 2009-07-28)
itself as neither of them is needed any more.
This warning ("'this': used in base member initializer list") is
disabled by default in all the still supported MSVC versions, so there
is no need to disable it.
Also disable a couple of C4702 ("unreachable code") which shouldn't
happen.
Switch to using the same "ub2" type as OCI uses for charset codes to
avoid warnings about implicitly truncating "int" to "ub2" when passing
charset parameters to various OCI functions.
Neither of these warnings (corresponding to copy ctor and assignment
operator not being synthesized by the compiler) are generated any
longer, so there is no need to suppress them.
We don't need to determine sizeof(long) at configure time when we can do
it directly during the build using std::conditional<>.
Also merge the identical specializations of various types for long in 32
and 64-bit cases.
Don't build with MSVS 2022 as this is tested on GitHub Actions now and
remove the second build using MSVS 2015, leaving just one using the
makefiles generator which is not otherwise tested.
Fix the workflow which was added in master to make it possible to use
it, but which didn't work yet.
Build SOCI under Windows using MSVC and run the tests that we can easily
run in the GitHub Actions environment (to run the other ones we would
need to set up PostgreSQL ODBC drivers and MySQL and SQL Server
databases ourselves).
The compiler somehow gives a warning about the loop line in this test
being unreachable, even though it clearly is.
Restructure the code to avoid returning from the loop to avoid it.
This is done mostly to avoid MSVC warnings about implicit __int64 to int
conversions, it should make no difference in practice as all sizes will
always be smaller than INT_MAX anyhow.
The return type of ssize() was inconsistent: it returned ssize_t with
C++20 but int otherwise.
Change the fallback function to conform to the standard one.
This was inconsistent with the rest of the SOCI code (and sometimes with
the operators in the same line!) and required including <iso646> with
MSVC which still doesn't support operator names without it, but this
header is removed in C++20, so including it is undesirable.
This isn't true, even at some time it was claimed that it was
(see #606), they are exported and using them does work even when using
SOCI as a DLL, provided SOCI_DLL symbol is defined, as it should be.
See #1255.
While there is no exact equivalent to this new database type among the
old dt_xxx constants, we still shouldn't throw from this function as
it's called from statement_impl::describe(), notably used by rowset API,
and throwing an exception from there prevented rowset from being used at
all with the NVARCHAR() columns mapped to db_wstring.
This was lost during CMake rewrite, but it makes sense to keep doing it,
as it's a common convention under Windows due to the absence of
SOVERSION equivalent, and it broke dynamic backend loading by name.
Fix this by moving ABI_VERSION definition to the main CMakefile and also
defining ABI_SUFFIX there, if necessary, which is appended to the names
of all libraries, if it is defined.
See #1248.