commit 742a0c1283d982821bb14ed2cdd998d5c1c86056 parent 2b1d40cca1d92ac3d01532dbab459fc7ca1266f6 Author: Michael Savage <mikejsavage@gmail.com> Date: Tue May 16 21:15:50 +0300 Upgrade to VS2015 + fix warnings Diffstat:
hm.cc | | | 2 | +- |
libs/glfw.lua | | | 2 | +- |
scripts/gen_makefile.lua | | | 21 | +++++++++++---------- |
win32_audio_output.cc | | | 4 | ++++ |
win32_audio_output.h | | | 4 | ++++ |
win32_backtrace.h | | | 8 | ++++++-- |
diff --git a/hm.cc b/hm.cc @@ -313,7 +313,7 @@ extern "C" GAME_FRAME( game_frame ) { player->pos = pos; } else if( player_state == 1 ) { - printf( "%08lx disconnected\n", player->sid ); + ggprint( "{08} disconnected\n", player->sid ); players.release( player ); } } diff --git a/libs/glfw.lua b/libs/glfw.lua @@ -18,5 +18,5 @@ elseif OS == "linux" then } ) end -windows_obj_replace_cxxflags( "libs/glfw/src/%", "/c /O2 /TC /D_GLFW_WIN32" ) -- compile as c +windows_obj_cxxflags( "libs/glfw/src/%", "/c /O2 /TC /D_GLFW_WIN32 /wd4152 /wd4204 /wd4244" ) -- compile as c linux_obj_replace_cxxflags( "libs/glfw/src/%", "-c -x c -O2 -D_GLFW_X11" ) diff --git a/scripts/gen_makefile.lua b/scripts/gen_makefile.lua @@ -7,7 +7,7 @@ local configs = { cxx = "...", lib = "...", - cxxflags = "/I . /c /Oi /Gm- /GR- /EHa- /nologo /DNOMINMAX /D_USE_MATH_DEFINES /DWIN32_LEAN_AND_MEAN", + cxxflags = "/I . /c /Oi /Gm- /GR- /EHa- /EHsc /nologo /DNOMINMAX /D_USE_MATH_DEFINES /DWIN32_LEAN_AND_MEAN", -- ldflags = "user32.lib shell32.lib opengl32.lib gdi32.lib Ws2_32.lib", ldflags = "user32.lib shell32.lib dbghelp.lib /nologo", warnings = "/W4 /wd4100 /wd4201 /wd4189 /wd4351 /wd4505 /wd4127 /wd4530 /wd4702 /D_CRT_SECURE_NO_WARNINGS", @@ -200,38 +200,39 @@ printf( "" ) if OS == "windows" then printf( [[ -VC = ${ProgramFiles(x86)}\Microsoft Visual Studio 12.0\VC -KIT = ${ProgramFiles(x86)}\Windows Kits\8.1 +VC = ${ProgramFiles(x86)}\Microsoft Visual Studio 14.0\VC +KIT81 = ${ProgramFiles(x86)}\Windows Kits\8.1 +KIT10 = ${ProgramFiles(x86)}\Windows Kits\10 DX = ${ProgramFiles(x86)}\Microsoft DirectX SDK (June 2010) -export INCLUDE := $(VC)\include;$(KIT)\Include\shared;$(DX)\Include;$(KIT)\Include\um;$(KIT)\Include\winrt -export LIB := $(VC)\lib\amd64;$(KIT)\lib\winv6.3\um\x64 -export PATH := /cygdrive/c/Program Files (x86)/Microsoft Visual Studio 12.0/VC/bin/amd64/:$(PATH) +export INCLUDE := $(VC)\include;$(KIT10)\Include\10.0.10240.0\ucrt;$(KIT81)\Include\shared;$(DX)\Include;$(KIT81)\Include\um;$(KIT81)\Include\winrt +export LIB := $(VC)\lib\amd64;$(KIT10)\Lib\10.0.10240.0\ucrt\x64;$(KIT81)\lib\winv6.3\um\x64 +export PATH := /cygdrive/c/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/amd64/:$(PATH) ]] ) printf( [[ $(BINS): %%: @printf "\e[1;31mbuilding $@\e[0m\n" @mkdir -p "$(@D)" - cl -Fe$@ $^ $(LDFLAGS) + @cl -Fe$@ $^ $(LDFLAGS) ]] ) printf( [[ %s/%%%s: %%.cc @printf "\e[1;32mbuilding $<\e[0m\n" @mkdir -p "$(@D)" - cl $(CXXFLAGS) -Fo$@ $^ + @cl $(CXXFLAGS) -Fo$@ $^ ]], dir, obj_suffix ) printf( [[ $(OBJS): %%: @printf "\e[1;32mbuilding $<\e[0m\n" @mkdir -p "$(@D)" - cl $(CXXFLAGS) -Fo$@ -Tp$< + @cl $(CXXFLAGS) -Fo$@ -Tp$< ]] ) printf( [[ %%%s: @printf "\e[1;35mbuilding $@\e[0m\n" @mkdir -p "$(@D)" - lib -OUT:$@ $^ + @lib -OUT:$@ $^ ]], lib_suffix ) else diff --git a/win32_audio_output.cc b/win32_audio_output.cc @@ -3,7 +3,11 @@ #include <windows.h> #include <wrl/client.h> #include <comdecl.h> + +#pragma warning( push ) +#pragma warning( disable : 4800 ) #include <xaudio2.h> +#pragma warning( pop ) #include "intrinsics.h" #include "log.h" diff --git a/win32_audio_output.h b/win32_audio_output.h @@ -5,7 +5,11 @@ #include "platform_atomic.h" #include <windows.h> + +#pragma warning( push ) +#pragma warning( disable : 4800 ) #include <xaudio2.h> +#pragma warning( pop ) struct AudioOutputDevice { IXAudio2SourceVoice * voice; diff --git a/win32_backtrace.h b/win32_backtrace.h @@ -1,7 +1,11 @@ #pragma once #include <windows.h> + +#pragma warning( push ) +#pragma warning( disable : 4091 ) #include <dbghelp.h> +#pragma warning( pop ) inline void print_backtrace() { const int max_symbol_len = 1024; @@ -27,10 +31,10 @@ inline void print_backtrace() { BOOL has_file_info = SymGetLineFromAddr64( process, addr64, &col, &line ); if( has_file_info ) { - printf( "%s (%s:%d - 0x%08lx)\n", symbol->Name, line.FileName, line.LineNumber, symbol->Address ); + printf( "%s (%s:%d - 0x%08I64x)\n", symbol->Name, line.FileName, line.LineNumber, symbol->Address ); } else { - printf( "%s (0x%08lx)\n", symbol->Name, symbol->Address ); + printf( "%s (0x%08I64x)\n", symbol->Name, symbol->Address ); } } }