Commit 81e83f99 authored by Simon Morlat's avatar Simon Morlat

Fix build issues with Visual Studio 2017

parent 06e4d63e
......@@ -43,6 +43,11 @@ include(CheckSymbolExists)
include(CMakePushCheckState)
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
# call include_directories here (see below)
......
......@@ -42,8 +42,8 @@ int main(int argc, char *argv[]) {
if (strstr(argv[0], ".libs")) {
int prefix_length = (int)(strstr(argv[0], ".libs") - argv[0]) + 1;
char prefix[200];
sprintf(prefix, "%s%.*s", argv[0][0] == '/' ? "" : "./", prefix_length, argv[0]);
char prefix[200] = { 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_writable_dir_prefix(prefix);
}
......
......@@ -41,7 +41,7 @@ static bool parseMessage(shared_ptr<Grammar> grammar, const string &message) {
shared_ptr<DebugElement> elem = parser->parseInput("sip-message", message, &pos);
BC_ASSERT_TRUE(elem != nullptr);
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());
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