summaryrefslogtreecommitdiff
path: root/boost/uuid
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2017-09-13 11:05:34 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2017-09-13 11:06:28 +0900
commit34bd32e225e2a8a94104489b31c42e5801cc1f4a (patch)
treed021b579a0c190354819974e1eaf0baa54b551f3 /boost/uuid
parentf763a99a501650eff2c60288aa6f10ef916d769e (diff)
downloadboost-34bd32e225e2a8a94104489b31c42e5801cc1f4a.tar.gz
boost-34bd32e225e2a8a94104489b31c42e5801cc1f4a.tar.bz2
boost-34bd32e225e2a8a94104489b31c42e5801cc1f4a.zip
Imported Upstream version 1.63.0upstream/1.63.0
Change-Id: Iac85556a04b7e58d63ba636dedb0986e3555714a Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
Diffstat (limited to 'boost/uuid')
-rw-r--r--boost/uuid/detail/uuid_x86.hpp8
-rw-r--r--boost/uuid/random_generator.hpp12
-rw-r--r--boost/uuid/seed_rng.hpp12
3 files changed, 18 insertions, 14 deletions
diff --git a/boost/uuid/detail/uuid_x86.hpp b/boost/uuid/detail/uuid_x86.hpp
index 303c45b086..120b8d60dc 100644
--- a/boost/uuid/detail/uuid_x86.hpp
+++ b/boost/uuid/detail/uuid_x86.hpp
@@ -68,7 +68,7 @@ inline bool uuid::is_nil() const BOOST_NOEXCEPT
#if defined(BOOST_UUID_USE_SSE41)
return _mm_test_all_zeros(mm, mm) != 0;
#else
- mm = _mm_cmpeq_epi8(mm, _mm_setzero_si128());
+ mm = _mm_cmpeq_epi32(mm, _mm_setzero_si128());
return _mm_movemask_epi8(mm) == 0xFFFF;
#endif
}
@@ -86,11 +86,11 @@ inline bool operator== (uuid const& lhs, uuid const& rhs) BOOST_NOEXCEPT
__m128i mm_left = uuids::detail::load_unaligned_si128(lhs.data);
__m128i mm_right = uuids::detail::load_unaligned_si128(rhs.data);
- __m128i mm_cmp = _mm_cmpeq_epi32(mm_left, mm_right);
-
#if defined(BOOST_UUID_USE_SSE41)
- return _mm_test_all_ones(mm_cmp) != 0;
+ __m128i mm = _mm_xor_si128(mm_left, mm_right);
+ return _mm_test_all_zeros(mm, mm) != 0;
#else
+ __m128i mm_cmp = _mm_cmpeq_epi32(mm_left, mm_right);
return _mm_movemask_epi8(mm_cmp) == 0xFFFF;
#endif
}
diff --git a/boost/uuid/random_generator.hpp b/boost/uuid/random_generator.hpp
index 0f4a0ab668..7ca025b74f 100644
--- a/boost/uuid/random_generator.hpp
+++ b/boost/uuid/random_generator.hpp
@@ -34,7 +34,7 @@ private:
public:
typedef uuid result_type;
-
+
// default constructor creates the random number generator
basic_random_generator()
: pURNG(new UniformRandomNumberGenerator)
@@ -49,7 +49,7 @@ public:
// seed the random number generator
detail::seed(*pURNG);
}
-
+
// keep a reference to a random number generator
// don't seed a given random number generator
explicit basic_random_generator(UniformRandomNumberGenerator& gen)
@@ -62,7 +62,7 @@ public:
)
)
{}
-
+
// keep a pointer to a random number generator
// don't seed a given random number generator
explicit basic_random_generator(UniformRandomNumberGenerator* pGen)
@@ -77,11 +77,11 @@ public:
{
BOOST_ASSERT(pURNG);
}
-
+
uuid operator()()
{
uuid u;
-
+
int i=0;
unsigned long random_value = generator();
for (uuid::iterator it=u.begin(); it!=u.end(); ++it, ++i) {
@@ -90,7 +90,7 @@ public:
i = 0;
}
- // static_cast gets rid of warnings of converting unsigned long to boost::uint8_t
+ // static_cast gets rid of warnings of converting unsigned long to boost::uint8_t
*it = static_cast<uuid::value_type>((random_value >> (i*8)) & 0xFF);
}
diff --git a/boost/uuid/seed_rng.hpp b/boost/uuid/seed_rng.hpp
index 5299b04821..388a8f9eae 100644
--- a/boost/uuid/seed_rng.hpp
+++ b/boost/uuid/seed_rng.hpp
@@ -40,14 +40,18 @@
#if defined(_MSC_VER)
# pragma warning(push) // Save warning settings.
# pragma warning(disable : 4996) // Disable deprecated std::fopen
+#if defined(_WIN32_WCE)
+# pragma comment(lib, "coredll.lib")
+#else
# pragma comment(lib, "advapi32.lib")
#endif
+#endif
#if defined(BOOST_WINDOWS)
# include <boost/detail/winapi/crypt.hpp> // for CryptAcquireContextA, CryptGenRandom, CryptReleaseContext
# include <boost/detail/winapi/timers.hpp>
-# include <boost/detail/winapi/process.hpp>
-# include <boost/detail/winapi/thread.hpp>
+# include <boost/detail/winapi/get_current_process_id.hpp>
+# include <boost/detail/winapi/get_current_thread_id.hpp>
#else
# include <sys/time.h> // for gettimeofday
# include <sys/types.h> // for pid_t
@@ -92,7 +96,7 @@ public:
, random_(NULL)
{
#if defined(BOOST_WINDOWS)
- if (!boost::detail::winapi::CryptAcquireContextA(
+ if (!boost::detail::winapi::CryptAcquireContextW(
&random_,
NULL,
NULL,
@@ -107,7 +111,7 @@ public:
std::memset(rd_, 0, sizeof(rd_));
}
-
+
~seed_rng() BOOST_NOEXCEPT
{
if (random_) {