• brucedawson's avatar
    Fix runtime-atomics for Win 10 SDK and remove volatile · b2ed2530
    brucedawson authored
    For unclear and probably accidental reasons the Windows 10 SDK
    renamed some _Interlocked* functions to _InlineInterlocked. This
    leads to these errors:
    
    runtime-atomics.cc(159): error C3861: '_InterlockedExchange64': identifier not found
    runtime-atomics.cc(159): error C3861: '_InterlockedExchangeAdd64': identifier not found
    runtime-atomics.cc(159): error C3861: '_InterlockedAnd64': identifier not found
    runtime-atomics.cc(159): error C3861: '_InterlockedOr64': identifier not found
    runtime-atomics.cc(159): error C3861: '_InterlockedXor64': identifier not found
    
    Fixing this requires either adding defines to map these five _Interlocked*
    functions to _InlineInterlocked*, or else changing to using the
    non-underscore versions. It appears that using the non-underscore versions
    is preferable so I went that way. This also requires adding three  new
    defines because there is a huge lack of consistency, probably due to these
    macros being defined sometimes in <intrin.h> and sometimes in <winnt.h>
    
    All five of the renamed 64-bit functions were manually checked to ensure
    that the change to the non-underscore versions would make no differences -
    the inline functions that they map to were identical. Other functions were
    spot-checked.
    
    Also, the 'volatile' qualifiers were removed. Volatile has no no useful
    meaning for multi-threaded programming. It only exists in the Interlocked*
    prototypes to *allow* volatile variables to be passed. Since this is a bad
    habit to encourage there is no reason for us to permit it, and we can
    still call the Microsoft functions (T* converts to volatile T*, just not
    vice-versa).
    
    The updated code builds with the Windows 8.1 SDK and with the Windows 10 SDK.
    
    R=jarin@chromium.org
    LOG=Y
    BUG=440500,491424
    
    Review URL: https://codereview.chromium.org/1228063005
    
    Cr-Commit-Position: refs/heads/master@{#29687}
    b2ed2530
Name
Last commit
Last update
benchmarks Loading commit data...
build Loading commit data...
include Loading commit data...
infra Loading commit data...
samples Loading commit data...
src Loading commit data...
test Loading commit data...
testing Loading commit data...
third_party/binutils Loading commit data...
tools Loading commit data...
.clang-format Loading commit data...
.gitignore Loading commit data...
.ycm_extra_conf.py Loading commit data...
AUTHORS Loading commit data...
BUILD.gn Loading commit data...
ChangeLog Loading commit data...
DEPS Loading commit data...
LICENSE Loading commit data...
LICENSE.strongtalk Loading commit data...
LICENSE.v8 Loading commit data...
LICENSE.valgrind Loading commit data...
Makefile Loading commit data...
Makefile.android Loading commit data...
Makefile.nacl Loading commit data...
OWNERS Loading commit data...
PRESUBMIT.py Loading commit data...
README.md Loading commit data...
WATCHLISTS Loading commit data...
codereview.settings Loading commit data...