[PATCH v2 03/12] vkd3d: Add MSVC path for atomic_add_fetch

Dmitry Timoshkov dmitry at baikal.ru
Tue Oct 1 06:09:00 CDT 2019


Hans-Kristian Arntzen <post at arntzen-software.no> wrote:

>  #if HAVE_SYNC_ADD_AND_FETCH
>  # define atomic_add_fetch(ptr, val) __sync_add_and_fetch(ptr, val)
> -#else
> -# error "atomic_add_fetch() not implemented for this platform"
> +#elif defined(_MSC_VER)
> +/* InterlockedAdd returns value after increment, like add_and_fetch. */
> +# define atomic_add_fetch(ptr, val) InterlockedAdd(ptr, val)
>  #endif  /* HAVE_SYNC_ADD_AND_FETCH */

Probably it would be better to still have the #error case.

-- 
Dmitry.



More information about the wine-devel mailing list