Mercurial > hg-stable
changeset 48325:3620ab28882d stable
cext: define S_IFLNK on Python 2.7 and Windows
Before this change, building on Python 2.7 on Windows fails due to
S_IFLNK being undefined. This regression was introduced by
a32a96079e2d / D11518.
It worked on Python 3 because its pyport.h (which is included via
Python.h) contains effectively the same code as added by this
changeset.
Differential Revision: https://phab.mercurial-scm.org/D11763
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Mon, 15 Nov 2021 19:53:01 -0800 |
parents | 141e38ef8d8f |
children | e74c15bd58ee |
files | mercurial/cext/parsers.c |
diffstat | 1 files changed, 6 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/cext/parsers.c Mon Nov 15 12:03:28 2021 +0100 +++ b/mercurial/cext/parsers.c Mon Nov 15 19:53:01 2021 -0800 @@ -25,6 +25,12 @@ #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong +#else +/* Windows on Python 2.7 doesn't define S_IFLNK. Python 3+ defines via + * pyport.h. */ +#ifndef S_IFLNK +#define S_IFLNK 0120000 +#endif #endif static const char *const versionerrortext = "Python minor version mismatch";