From patchwork Wed Oct 14 10:38:13 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [1,of,3] exewrapper: report name of failed DLL in error message From: Adrian Buehlmann X-Patchwork-Id: 11044 Message-Id: To: Mercurial-devel@selenic.com Date: Wed, 14 Oct 2015 12:38:13 +0200 # HG changeset patch # User Adrian Buehlmann # Date 1444818129 -7200 # Node ID b8bf5a263a32ff73a4da0ba1512c0f1c42b49b88 # Parent 79d86ab65c9def3fdd65ec972bc5fa89688a19ff exewrapper: report name of failed DLL in error message This uses C string literal concatenation. Example output: $ hg version abort: failed to load Python DLL python27.dll Note that HGPYTHONLIB does not contain the trailing .dll, which works here because the dcoumentation of LoadLibrary [1] says, that if no file name extension is specified in the filename parameter, the default library extension .dll is appended. See [2] for a motivation of this change. [1] https://msdn.microsoft.com/en-us/library/windows/desktop/ms684175(v=vs.85).aspx [2] https://selenic.com/pipermail/mercurial/2015-August/048627.html diff --git a/mercurial/exewrapper.c b/mercurial/exewrapper.c --- a/mercurial/exewrapper.c +++ b/mercurial/exewrapper.c @@ -106,7 +106,7 @@ if (pydll == NULL) { pydll = LoadLibrary(HGPYTHONLIB); if (pydll == NULL) { - err = "failed to load Python DLL"; + err = "failed to load Python DLL " HGPYTHONLIB ".dll"; goto bail; } }