monotone-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Monotone-devel] Re: [PATCH] trunk doesn't compile on cygwin


From: Lapo Luchini
Subject: [Monotone-devel] Re: [PATCH] trunk doesn't compile on cygwin
Date: Fri, 16 Jun 2006 20:43:13 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.8.0.4) Gecko/20060516 Thunderbird/1.5.0.4 Mnenhy/0.7.4.0 Hamster/2.0.0.1

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Lapo Luchini wrote:
> xdelta.cc:88:   instantiated from here
> /usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/ext/hashtable.h:518:
> error: no match for call to `(const hashmap::hash<u32>) (const long
>  unsigned int&)' make[2]: *** [mtn-xdelta.o] Error 1
OK, I found a solution.
hashmap template seems to miss an operator() that can apply to
"unsigned long int", such as the ones used in xxdelta.cc.

I'm not sure why it happens, but anyway... someone which knows better
the argument, please comment on it.
Should I commit it in a "#ifdef CYGWIN" clause?
Whose "fault" it is?
gcc 3.4.4? Cygwin's STL linraries? It is just not supposed to work on
that release?

Anyway, here comes the patch:

#
# old_revision [1cc8e2cb464dcb8249bf6e699855a139ed9a7edc]
#
# patch "hash_map.hh"
#  from [31c2c4fe7ee4f4f734405fdaf34362fd371e2028]
#    to [92a7bde9789f84a9cf6fec74f71f58385bcb421d]
#
============================================================
- --- hash_map.hh 31c2c4fe7ee4f4f734405fdaf34362fd371e2028
+++ hash_map.hh 92a7bde9789f84a9cf6fec74f71f58385bcb421d
@@ -50,6 +50,15 @@
     }
   };
 
+  template<>
+  struct hash<unsigned long int>
+  {
+    size_t operator()(unsigned long int const & i) const
+    {
+      return i * 65537;
+    }
+  };
+
   template<typename _Key, typename _Value>
   class hash_map : public __gnu_cxx::hash_map<_Key,
                                               _Value,

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.1 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iQIcBAEBAgAGBQJEkvvBAAoJELBiMTth2oCD9IsQALNm4xblPZFl1eghvql5vYlp
4D6CUPe01CJ8woSWKbZzKiUOhybgbi9iJ+PfNiuFykK+XpxWyrs4g9XiUy0RMQ24
Jo+BPBhVDWddWyy37s27FD8+NeUr/5b0jBmymxyQgEpWEb3d3ax7mXEOcIqo/o+H
LLzAMWwbqCTql1qObqlf2aQYTJuZCzPqVTiFO76d7iIaS2OO6BpzhABQTCx2cD/l
iRevrr2c0VNulEsSpuT+RHwCKXNtkEWTk2jm6qnwDWNbCI8UuMJf5fHMCF7QdLuR
XCZTAjaioyMs5HQ5e/qR+aYRMq6lks+Ufb0RMJEAeUH3mAug4YH9jO9pslLW2Oo3
zlDzAkKxbtG6vh/Kvt4fPnE1vEX3Cpv/8Pym5Cbvgi9PqtnK3mVVo+YJy74lMdAC
RLMhFvA1XQziS3IkF5TPctsGrX4s8d5zkHD8r5azNvvg6AkEU/QIgEUUWemGEorG
aKqDgAzZwZ9E+ihGcM9cIY3NbL5QrJBXVQOTtihOrHdDcZGleQDKbeX8IVvG00m9
UBel+nexwzpwx/WN9R5s7j8GhqXZs11RhNia/EPpLbsB79NMfDzzFjtKxI+87fR1
UOU0gql0ZJELmKxcqRfUw8WUtYTbpkLo9L8NzhecWs0OEoJWIbCg5SLxf1Fp9aWK
wkyyBjWAuU2f26IoZRAR
=Nj67
-----END PGP SIGNATURE-----





reply via email to

[Prev in Thread] Current Thread [Next in Thread]