fixed strict aliasing warning on gcc
This commit is contained in:
parent
600e280dda
commit
ccb808638d
|
@ -26,6 +26,7 @@
|
||||||
incoming connection
|
incoming connection
|
||||||
* added more detailed instrumentation of the disk I/O thread
|
* added more detailed instrumentation of the disk I/O thread
|
||||||
|
|
||||||
|
* fixed strict aliasing warning on gcc
|
||||||
* fixed inconsistency when creating torrents with symlinks
|
* fixed inconsistency when creating torrents with symlinks
|
||||||
* properly detect windows version to initialize half-open connection limit
|
* properly detect windows version to initialize half-open connection limit
|
||||||
* fixed bug in url encoder where $ would not be encoded
|
* fixed bug in url encoder where $ would not be encoded
|
||||||
|
|
|
@ -169,24 +169,19 @@ namespace libtorrent
|
||||||
// workaround for msvc-bug.
|
// workaround for msvc-bug.
|
||||||
// assumes sizeof(map<string, char>) == sizeof(map<string, entry>)
|
// assumes sizeof(map<string, char>) == sizeof(map<string, entry>)
|
||||||
// and sizeof(list<char>) == sizeof(list<entry>)
|
// and sizeof(list<char>) == sizeof(list<entry>)
|
||||||
union
|
integer_type data[
|
||||||
{
|
(max4<sizeof(std::list<char>)
|
||||||
char data[
|
, sizeof(std::map<std::string, char>)
|
||||||
max4<sizeof(std::list<char>)
|
, sizeof(string_type)
|
||||||
, sizeof(std::map<std::string, char>)
|
, sizeof(integer_type)>::value + sizeof(integer_type) - 1)
|
||||||
, sizeof(string_type)
|
/ sizeof(integer_type)];
|
||||||
, sizeof(integer_type)>::value];
|
|
||||||
integer_type dummy_aligner;
|
|
||||||
};
|
|
||||||
#else
|
#else
|
||||||
union
|
integer_type data[
|
||||||
{
|
(max4<sizeof(list_type)
|
||||||
char data[max4<sizeof(list_type)
|
, sizeof(dictionary_type)
|
||||||
, sizeof(dictionary_type)
|
, sizeof(string_type)
|
||||||
, sizeof(string_type)
|
, sizeof(integer_type)>::value + sizeof(integer_type) - 1)
|
||||||
, sizeof(integer_type)>::value];
|
/ sizeof(integer_type)];
|
||||||
integer_type dummy_aligner;
|
|
||||||
};
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef TORRENT_DEBUG
|
#ifdef TORRENT_DEBUG
|
||||||
|
|
Loading…
Reference in New Issue