Skip to content

Commit

Permalink
Repair VC8 compile of test applications (#593)
Browse files Browse the repository at this point in the history
Fix compilation issues for Visual C++ 8.0 (VS2005)

* Add _WIN32_WINNT minimal required version to soci-platform.h to fix windows.h issue related to use of Add/RemoveVectoredExceptionHandler.
* Override SECTION macro since default macro parameter (3 required / 2 given or 2 required / 1 given) do not expand and lead to syntax error.
  • Loading branch information
hrabe authored and mloskot committed Sep 23, 2017
1 parent c2310cf commit 51d058f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 3 additions & 0 deletions include/soci/soci-platform.h
Expand Up @@ -74,6 +74,9 @@ namespace std {

//define DLL import/export on WIN32
#ifdef _WIN32
# ifndef _WIN32_WINNT
# define _WIN32_WINNT 0x0502 //_WIN32_WINNT_WS03, VS2015 support: https://msdn.microsoft.com/de-de/library/6sehtctf.aspx
# endif // _WIN32_WINNT
# ifdef SOCI_DLL
# ifdef SOCI_SOURCE
# define SOCI_DECL __declspec(dllexport)
Expand Down
7 changes: 6 additions & 1 deletion tests/common-tests.h
Expand Up @@ -26,6 +26,11 @@
#define CATCH_CONFIG_RUNNER
#include <catch.hpp>

#if defined(_MSC_VER) && (_MSC_VER < 1500)
#undef SECTION
#define SECTION(name) INTERNAL_CATCH_SECTION(name, "dummy-for-vc8")
#endif

#include <algorithm>
#include <cassert>
#include <clocale>
Expand Down Expand Up @@ -537,7 +542,7 @@ TEST_CASE_METHOD(common_tests, "Exception on not connected", "[core][exception]"
CHECK_THROWS_AS(sql.get_last_insert_id(s, l), soci_error);
}

TEST_CASE_METHOD(common_tests, "Basic functionality")
TEST_CASE_METHOD(common_tests, "Basic functionality", "[core][basics]")
{
soci::session sql(backEndFactory_, connectString_);

Expand Down

0 comments on commit 51d058f

Please sign in to comment.