Fixed Visual Studio 2015 builds.

This commit is contained in:
Pietro Gagliardi 2016-05-13 15:13:41 -04:00
parent 3425963606
commit 03337f61f1
3 changed files with 5 additions and 2 deletions

View File

@ -26,12 +26,13 @@
# TODO loads of warnings in the system header files
# TODO /analyze requires us to write annotations everywhere
# TODO undecided flags from qo?
# -RTCc is not supplied because it's discouraged as of VS2015; see https://www.reddit.com/r/cpp/comments/46mhne/rtcc_rejects_conformant_code_with_visual_c_2015/d06auq5
CFLAGS += \
-W4 \
-wd4100 \
-TC \
-bigobj -nologo \
-RTC1 -RTCc -RTCs -RTCu
-RTC1 -RTCs -RTCu
# TODO prune these
# -EHsc is to shut the compiler up in some cases
@ -40,7 +41,7 @@ CXXFLAGS += \
-wd4100 \
-TP \
-bigobj -nologo \
-RTC1 -RTCc -RTCs -RTCu \
-RTC1 -RTCs -RTCu \
-EHsc
# TODO warnings on undefined symbols

View File

@ -44,6 +44,7 @@ static HRESULT doPaint(uiArea *a, ID2D1RenderTarget *rt, RECT *clip)
bgcolor.r = ((float) GetRValue(bgcolorref)) / 255.0;
// due to utter apathy on Microsoft's part, GetGValue() does not work with MSVC's Run-Time Error Checks
// it has not worked since 2008 and they have *never* fixed it
// TODO now that -RTCc has just been deprecated entirely, should we switch back?
bgcolor.g = ((float) ((BYTE) ((bgcolorref & 0xFF00) >> 8))) / 255.0;
bgcolor.b = ((float) GetBValue(bgcolorref)) / 255.0;
bgcolor.a = 1.0;

View File

@ -26,6 +26,7 @@ static HRESULT d2dScratchDoPaint(HWND hwnd, ID2D1RenderTarget *rt)
bgcolor.r = ((float) GetRValue(bgcolorref)) / 255.0;
// due to utter apathy on Microsoft's part, GetGValue() does not work with MSVC's Run-Time Error Checks
// it has not worked since 2008 and they have *never* fixed it
// TODO now that -RTCc has just been deprecated entirely, should we switch back?
bgcolor.g = ((float) ((BYTE) ((bgcolorref & 0xFF00) >> 8))) / 255.0;
bgcolor.b = ((float) GetBValue(bgcolorref)) / 255.0;
bgcolor.a = 1.0;