Commit af15bbb9 authored by Simon Morlat's avatar Simon Morlat
Browse files

Merge branch 'fix/msvc' into 'master'

Fix build issues with Visual Studio 2017

See merge request !6
parents 06e4d63e 81e83f99
...@@ -43,6 +43,11 @@ include(CheckSymbolExists) ...@@ -43,6 +43,11 @@ include(CheckSymbolExists)
include(CMakePushCheckState) include(CMakePushCheckState)
include(CheckCXXCompilerFlag) include(CheckCXXCompilerFlag)
if(MSVC)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
endif()
# find_package should be invoked here to check for libraries - however do NOT # find_package should be invoked here to check for libraries - however do NOT
# call include_directories here (see below) # call include_directories here (see below)
......
...@@ -42,8 +42,8 @@ int main(int argc, char *argv[]) { ...@@ -42,8 +42,8 @@ int main(int argc, char *argv[]) {
if (strstr(argv[0], ".libs")) { if (strstr(argv[0], ".libs")) {
int prefix_length = (int)(strstr(argv[0], ".libs") - argv[0]) + 1; int prefix_length = (int)(strstr(argv[0], ".libs") - argv[0]) + 1;
char prefix[200]; char prefix[200] = { 0 };
sprintf(prefix, "%s%.*s", argv[0][0] == '/' ? "" : "./", prefix_length, argv[0]); snprintf(prefix, sizeof(prefix)-1, "%s%.*s", argv[0][0] == '/' ? "" : "./", prefix_length, argv[0]);
bc_tester_set_resource_dir_prefix(prefix); bc_tester_set_resource_dir_prefix(prefix);
bc_tester_set_writable_dir_prefix(prefix); bc_tester_set_writable_dir_prefix(prefix);
} }
......
...@@ -41,7 +41,7 @@ static bool parseMessage(shared_ptr<Grammar> grammar, const string &message) { ...@@ -41,7 +41,7 @@ static bool parseMessage(shared_ptr<Grammar> grammar, const string &message) {
shared_ptr<DebugElement> elem = parser->parseInput("sip-message", message, &pos); shared_ptr<DebugElement> elem = parser->parseInput("sip-message", message, &pos);
BC_ASSERT_TRUE(elem != nullptr); BC_ASSERT_TRUE(elem != nullptr);
if (!elem) return FALSE; if (!elem) return FALSE;
BC_ASSERT_EQUAL(pos, message.size(), int, "%i"); BC_ASSERT_EQUAL((int)pos, (int)message.size(), int, "%i");
BC_ASSERT_TRUE(message == elem->getValue()); BC_ASSERT_TRUE(message == elem->getValue());
return message.size() == pos && message == elem->getValue(); return message.size() == pos && message == elem->getValue();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment