# HG changeset patch # User Matt Harbison # Date 2021-01-26 00:03:27 # Node ID ab2d02e12dbb7c469c95d890b860a1836c76d877 # Parent fabd8207adc34f54fc59d3687ad93be766c77289 cext: restore the ability to build on Windows with py2 This broke in e92ca942ddca. Differential Revision: https://phab.mercurial-scm.org/D9867 diff --git a/contrib/python-zstandard/zstd/common/pythoncapi_compat.h b/contrib/python-zstandard/zstd/common/pythoncapi_compat.h --- a/contrib/python-zstandard/zstd/common/pythoncapi_compat.h +++ b/contrib/python-zstandard/zstd/common/pythoncapi_compat.h @@ -20,6 +20,11 @@ extern "C" { #include "frameobject.h" // PyFrameObject, PyFrame_GetBack() +/* VC 2008 doesn't know about the inline keyword. */ +#if defined(_MSC_VER) && _MSC_VER < 1900 +#define inline __forceinline +#endif + // Cast argument to PyObject* type. #ifndef _PyObject_CAST # define _PyObject_CAST(op) ((PyObject*)(op)) diff --git a/mercurial/pythoncapi_compat.h b/mercurial/pythoncapi_compat.h --- a/mercurial/pythoncapi_compat.h +++ b/mercurial/pythoncapi_compat.h @@ -20,6 +20,11 @@ extern "C" { #include "frameobject.h" // PyFrameObject, PyFrame_GetBack() +/* VC 2008 doesn't know about the inline keyword. */ +#if defined(_MSC_VER) && _MSC_VER < 1900 +#define inline __forceinline +#endif + // Cast argument to PyObject* type. #ifndef _PyObject_CAST # define _PyObject_CAST(op) ((PyObject*)(op))