Skip to content

Commit

Permalink
/std:c++latest for MSVC, fix bool flip, warn opts
Browse files Browse the repository at this point in the history
Use `/std:c++latest` for Visual Studio because the XBRZ 1.7 code
requires at least C++17.

Replace the use of `bool++` in `GBALink.cpp` which is now apparently an
error with `bool = !bool` to flip the value.

Use `/W4` to enable a good amount of warnings in Debug mode, and `/W0`
to disable warnings entirely in release modes.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
  • Loading branch information
rkitover committed Aug 30, 2019
1 parent 234f1e9 commit 381a7bf
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions CMakeLists.txt
Expand Up @@ -610,6 +610,14 @@ if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID STREQUAL Clang)

set(CMAKE_C_LINK_EXECUTABLE "${CMAKE_C_LINK_EXECUTABLE} ${MY_C_LINKER_FLAGS_STR}")
set(CMAKE_CXX_LINK_EXECUTABLE "${CMAKE_CXX_LINK_EXECUTABLE} ${MY_C_LINKER_FLAGS_STR}")
elseif(MSVC)
add_compile_options(/std:c++latest)

if(CMAKE_BUILD_TYPE STREQUAL Debug)
add_compile_options(/W4)
else()
add_compile_options(/W0)
endif()
endif()

# Assembler flags
Expand Down
2 changes: 1 addition & 1 deletion src/gba/GBALink.cpp
Expand Up @@ -2925,7 +2925,7 @@ static void UpdateCableIPC(int ticks)
}

// next cycle
transfer_direction++;
transfer_direction = !transfer_direction;
}

if (transfer_direction > linkmem->trgbas && linktime >= trtimeend[transfer_direction - 3][tspeed]) {
Expand Down

0 comments on commit 381a7bf

Please sign in to comment.