Project

General

Profile

Emulator Issues #12170

Dolphin build failed on MSVC under /Zc:preprocessor

Added by QuellaZhang 8 months ago. Updated 8 months ago.

Status:
Fixed
Priority:
Normal
Assignee:
-
% Done:

0%

Operating system:
Windows
Issue type:
Bug
Milestone:
Regression:
No
Relates to usability:
No
Relates to performance:
No
Easy:
No
Relates to maintainability:
Yes
Regression start:
Fixed in:
5.0-12239

Description

Hi All,

The MSVC team uses Dolphin as a part of testing to detect compiler regression, recently we build Dolphin under /Zc:preprocessor and got the below error. We provides a workaround, can you help look? There maybe more files need to be modified.

The issue is that the old preprocessor is very aggressive at removing commas before a VA_ARGS, but the new one only removes them when they are prefixed by ## (same as GCC and Clang). The fix is to branch to the other implementation of the macros when _MSVC_TRADITIONAL is defined and equal to 0. So for example in https://github.com/dolphin-emu/dolphin/blob/master/Source/Core/Common/MsgHandler.h#L35 instead of
#ifdef _WIN32
It should be
#if defined(_WIN32) && (!defined(_MSVC_TRADITIONAL) || _MSVC_TRADITIONAL == 1)

Attach the build log for detail.

errors:
F:\gitP\dolphin-emu\dolphin\Source\Core\Common\MemoryUtil.cpp(66,5): error C2059: syntax error: ')' [F:\gitP\dolphin-emu\dolphin\Source\Core\Common\Common.vcxproj]
F:\gitP\dolphin-emu\dolphin\Source\Core\Common\MemoryUtil.cpp(66,5): error C2059: PanicAlert("Failed to allocate raw memory"); [F:\gitP\dolphin-emu\dolphin\Source\Core\Common\Common.vcxproj]
F:\gitP\dolphin-emu\dolphin\Source\Core\Common\MemoryUtil.cpp(66,5): error C2059: ^ [F:\gitP\dolphin-emu\dolphin\Source\Core\Common\Common.vcxproj]
F:\gitP\dolphin-emu\dolphin\Source\Core\Common\MemoryUtil.cpp(82,5): error C2059: syntax error: ')' [F:\gitP\dolphin-emu\dolphin\Source\Core\Common\Common.vcxproj]
F:\gitP\dolphin-emu\dolphin\Source\Core\Common\MemoryUtil.cpp(82,5): error C2059: PanicAlert("Failed to allocate aligned memory"); [F:\gitP\dolphin-emu\dolphin\Source\Core\Common\Common.vcxproj]
F:\gitP\dolphin-emu\dolphin\Source\Core\Common\MemoryUtil.cpp(82,5): error C2059: ^ [F:\gitP\dolphin-emu\dolphin\Source\Core\Common\Common.vcxproj]

build.log (563 KB) build.log QuellaZhang, 06/29/2020 09:53 AM

History

#1 Updated by JosJuice 8 months ago

  • Status changed from New to Fix pending

#2 Updated by JosJuice 8 months ago

  • Relates to maintainability changed from No to Yes
  • Operating system Windows added
  • Operating system deleted (N/A)

#3 Updated by Lioncash 8 months ago

  • Status changed from Fix pending to Fixed

Also available in: Atom PDF