[PATCH 5 of 5 v5] store: implement fncache hash encoding in C

Adrian Buehlmann adrian at cadifra.com
Thu Sep 13 11:08:54 CDT 2012


On 2012-09-10 22:35, Bryan O'Sullivan wrote:
> # HG changeset patch
> # User Bryan O'Sullivan <bryano at fb.com>
> # Date 1347309263 25200
> # Node ID bd3831e77556a584bd581cd8ff7140e3404f6b68
> # Parent  c2cc9263d4969b22b4b9fd39f22e97c70fc700a2
> store: implement fncache hash encoding in C

Fails to compile and link with MS C:

  pathencode.obj : error LNK2019: unresolved external symbol alloca referenced in function hashencode


Which I can fix here by including header malloc.h


diff --git a/mercurial/pathencode.c b/mercurial/pathencode.c
--- a/mercurial/pathencode.c
+++ b/mercurial/pathencode.c
@@ -20,6 +20,7 @@
 #include <ctype.h>
 #include <stdlib.h>
 #include <string.h>
+#include <malloc.h>
 
 #include "util.h"
 


$ python setup.py build_ext -i
running build_ext
building 'mercurial.parsers' extension
C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -IC:\Python\include -IC:\Python\PC /Tcm
ercurial/parsers.c /Fobuild\temp.win-amd64-2.7\Release\mercurial/parsers.obj
parsers.c
mercurial/parsers.c(593) : warning C4244: '+=' : conversion from 'Py_ssize_t' to 'long', possible loss of data
mercurial/parsers.c(634) : warning C4090: 'function' : different 'const' qualifiers
mercurial/parsers.c(776) : warning C4244: 'function' : conversion from 'Py_ssize_t' to 'long', possible loss of data
mercurial/parsers.c(916) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data
mercurial/parsers.c(1320) : warning C4244: 'return' : conversion from 'Py_ssize_t' to 'long', possible loss of data
C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -IC:\Python\include -IC:\Python\PC /Tcm
ercurial/pathencode.c /Fobuild\temp.win-amd64-2.7\Release\mercurial/pathencode.obj
pathencode.c
mercurial/pathencode.c(638) : warning C4013: 'alloca' undefined; assuming extern returning int
mercurial/pathencode.c(638) : warning C4047: 'initializing' : 'char *' differs in levels of indirection from 'int'
mercurial/pathencode.c(639) : warning C4047: 'initializing' : 'char *' differs in levels of indirection from 'int'
mercurial/pathencode.c(640) : warning C4047: 'initializing' : 'char *' differs in levels of indirection from 'int'
C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\amd64\link.exe /DLL /nologo /INCREMENTAL:NO /LIBPATH:C:\Python\libs /LIBPATH:C:\Python\PC
build\amd64 /EXPORT:initparsers build\temp.win-amd64-2.7\Release\mercurial/parsers.obj build\temp.win-amd64-2.7\Release\mercurial/pathencode.obj /O
UT:C:\Users\adi\hgrepos\hg-main\mercurial\parsers.pyd /IMPLIB:build\temp.win-amd64-2.7\Release\mercurial\parsers.lib /MANIFESTFILE:build\temp.win-a
md64-2.7\Release\mercurial\parsers.pyd.manifest
parsers.obj : warning LNK4197: export 'initparsers' specified multiple times; using first specification
   Creating library build\temp.win-amd64-2.7\Release\mercurial\parsers.lib and object build\temp.win-amd64-2.7\Release\mercurial\parsers.exp
pathencode.obj : error LNK2019: unresolved external symbol alloca referenced in function hashencode
C:\Users\adi\hgrepos\hg-main\mercurial\parsers.pyd : fatal error LNK1120: 1 unresolved externals
error: command '"C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\amd64\link.exe"' failed with exit status 1120


More information about the Mercurial-devel mailing list