# HG changeset patch # User Matt Harbison # Date 1539988482 14400 # Node ID 36b134c436b89abe7d4ff4550cfb5afc0de1065c # Parent 973ff03d9bc096ce9e1ce5039cc673c443e8c13b setup: build exewrapper with Unicode support on py3 I didn't see a compiler switch documented anywhere, but I diffed the command line for full VC++ project when toggling between MBCS and Unicode. This is all they do. diff -r 973ff03d9bc0 -r 36b134c436b8 setup.py --- a/setup.py Fri Oct 19 18:32:13 2018 -0400 +++ b/setup.py Fri Oct 19 18:34:42 2018 -0400 @@ -631,8 +631,14 @@ with open('mercurial/hgpythonlib.h', 'wb') as f: f.write(b'/* this file is autogenerated by setup.py */\n') f.write(b'#define HGPYTHONLIB "%s"\n' % pythonlib) + + macros = None + if sys.version_info[0] >= 3: + macros = [('_UNICODE', None), ('UNICODE', None)] + objects = self.compiler.compile(['mercurial/exewrapper.c'], - output_dir=self.build_temp) + output_dir=self.build_temp, + macros=macros) dir = os.path.dirname(self.get_ext_fullpath('dummy')) self.hgtarget = os.path.join(dir, 'hg') self.compiler.link_executable(objects, self.hgtarget,