Skip to content

Commit

Permalink
Update compatibility with VS2015 and debug options
Browse files Browse the repository at this point in the history
- Add -EHsc flag to windows build
- Guard the generation of the debug "output.dat" containing uncompressed save data under _DEBUG.
  • Loading branch information
tracktwo committed Oct 6, 2016
1 parent 5198ca1 commit 8bfd0ff
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Expand Up @@ -11,8 +11,8 @@ endif (UNIX)

if (WIN32)
add_definitions(-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE)
set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -MTd")
set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -MT")
set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -MTd -EHsc")
set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -MT -EHsc")
endif (WIN32)

include_directories("minilzo-2.09" "json11")
Expand Down
3 changes: 2 additions & 1 deletion xcomreader.cpp
Expand Up @@ -692,10 +692,11 @@ namespace xcom
xcom_io rdr{ std::move(b) };
save.hdr = read_header(rdr);
buffer<unsigned char> uncompressed_buf = decompress(rdr);
#ifdef _DEBUG
FILE *fp = fopen("output.dat", "wb");
fwrite(uncompressed_buf.buf.get(), 1, uncompressed_buf.length, fp);
fclose(fp);
#endif
xcom_io uncompressed(std::move(uncompressed_buf));
save.actors = read_actor_table(uncompressed);
save.checkpoints = read_checkpoint_chunk_table(uncompressed);
Expand Down

0 comments on commit 8bfd0ff

Please sign in to comment.