Patchwork D9867: cext: restore the ability to build on Windows with py2

login
register
mail settings
Submitter phabricator
Date Jan. 26, 2021, 12:26 a.m.
Message ID <differential-rev-PHID-DREV-p6zgg7m35ruvygw4bdyt-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/48178/
State Superseded
Headers show

Comments

phabricator - Jan. 26, 2021, 12:26 a.m.
mharbison72 created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  This broke in e92ca942ddca <https://phab.mercurial-scm.org/rHGe92ca942ddca2b10cd9ae1321dd0193203ca4d25>.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D9867

AFFECTED FILES
  contrib/python-zstandard/zstd/common/pythoncapi_compat.h
  mercurial/pythoncapi_compat.h

CHANGE DETAILS




To: mharbison72, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

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 @@ 
 #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/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 @@ 
 #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))