Below is the list of changes that have just been committed into a local
5.0 repository of svoj. When svoj does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet
1.1945 05/06/16 16:35:09 svoj@stripped +15 -0
WL#2286 - Compile MySQL w/YASSL support
Merge with latest yaSSL.
extra/yassl/taocrypt/src/random.cpp
1.4 05/06/16 16:35:02 svoj@stripped +5 -5
Merge with latest yaSSL.
extra/yassl/taocrypt/src/misc.cpp
1.7 05/06/16 16:35:02 svoj@stripped +0 -16
Merge with latest yaSSL.
extra/yassl/taocrypt/src/integer.cpp
1.11 05/06/16 16:35:02 svoj@stripped +34 -6
Merge with latest yaSSL.
extra/yassl/taocrypt/src/asn.cpp
1.4 05/06/16 16:35:02 svoj@stripped +0 -1
Merge with latest yaSSL.
extra/yassl/taocrypt/include/types.hpp
1.4 05/06/16 16:35:02 svoj@stripped +7 -9
Merge with latest yaSSL.
extra/yassl/taocrypt/include/random.hpp
1.2 05/06/16 16:35:02 svoj@stripped +1 -1
Merge with latest yaSSL.
extra/yassl/taocrypt/include/misc.hpp
1.6 05/06/16 16:35:02 svoj@stripped +2 -9
Merge with latest yaSSL.
extra/yassl/src/timer.cpp
1.3 05/06/16 16:35:02 svoj@stripped +3 -3
Merge with latest yaSSL.
extra/yassl/src/ssl.cpp
1.7 05/06/16 16:35:02 svoj@stripped +1 -1
Merge with latest yaSSL.
extra/yassl/src/socket_wrapper.cpp
1.4 05/06/16 16:35:02 svoj@stripped +8 -8
Merge with latest yaSSL.
extra/yassl/src/log.cpp
1.4 05/06/16 16:35:02 svoj@stripped +2 -2
Merge with latest yaSSL.
extra/yassl/src/lock.cpp
1.3 05/06/16 16:35:01 svoj@stripped +3 -3
Merge with latest yaSSL.
extra/yassl/mySTL/helpers.hpp
1.6 05/06/16 16:35:01 svoj@stripped +15 -8
Merge with latest yaSSL.
extra/yassl/include/socket_wrapper.hpp
1.4 05/06/16 16:35:01 svoj@stripped +2 -2
Merge with latest yaSSL.
extra/yassl/include/lock.hpp
1.2 05/06/16 16:35:01 svoj@stripped +3 -3
Merge with latest yaSSL.
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: svoj
# Host: svoj.pils.ru
# Root: /home/svoj/devel/mysql/yassl-mysql-5.0
--- 1.1/extra/yassl/include/lock.hpp 2005-04-28 18:23:03 +05:00
+++ 1.2/extra/yassl/include/lock.hpp 2005-06-16 16:35:01 +05:00
@@ -31,7 +31,7 @@
#ifdef MULTI_THREADED
- #ifdef WIN32
+ #ifdef _WIN32
#include <windows.h>
class Mutex {
@@ -50,7 +50,7 @@
~Lock();
};
};
- #else // WIN32
+ #else // _WIN32
#include <pthread.h>
class Mutex {
@@ -71,7 +71,7 @@
};
};
- #endif // WIN32
+ #endif // _WIN32
#else // MULTI_THREADED (WE'RE SINGLE)
class Mutex {
--- 1.3/extra/yassl/include/socket_wrapper.hpp 2005-05-31 20:56:24 +05:00
+++ 1.4/extra/yassl/include/socket_wrapper.hpp 2005-06-16 16:35:01 +05:00
@@ -31,7 +31,7 @@
#include <assert.h>
-#ifdef WIN32
+#ifdef _WIN32
#include <winsock2.h>
#else
#include <sys/time.h>
@@ -47,7 +47,7 @@
typedef unsigned int uint;
-#ifdef WIN32
+#ifdef _WIN32
typedef SOCKET socket_t;
#else
typedef int socket_t;
--- 1.5/extra/yassl/mySTL/helpers.hpp 2005-05-31 20:56:24 +05:00
+++ 1.6/extra/yassl/mySTL/helpers.hpp 2005-06-16 16:35:01 +05:00
@@ -31,32 +31,39 @@
#include <new> // placement new
+
#ifdef __IBMCPP__
/*
- Workaround for the lack of operator new(size_t, void*)
- in IBM VA C++ 6.0
+ Workaround for the lack of operator new(size_t, void*)
+ in IBM VA C++ 6.0
*/
-struct Dummy {};
-inline void *operator new(size_t size, Dummy *d) { return (void*) d; }
-typedef Dummy *yassl_pointer;
+ struct Dummy {};
+
+ inline void* operator new(size_t size, Dummy* d)
+ {
+ return static_cast<void*>(d);
+ }
+
+ typedef Dummy* yassl_pointer;
#else
-typedef void *yassl_pointer;
+ typedef void* yassl_pointer;
#endif
+
namespace mySTL {
template <typename T, typename T2>
inline void construct(T* p, const T2& value)
{
- new ((yassl_pointer) p) T(value);
+ new (reinterpret_cast<yassl_pointer>(p)) T(value);
}
template <typename T>
inline void construct(T* p)
{
- new (static_cast<void*>(p)) T();
+ new (reinterpret_cast<yassl_pointer>(p)) T();
}
--- 1.2/extra/yassl/src/lock.cpp 2005-05-31 20:56:25 +05:00
+++ 1.3/extra/yassl/src/lock.cpp 2005-06-16 16:35:01 +05:00
@@ -29,7 +29,7 @@
#ifdef MULTI_THREADED
- #ifdef WIN32
+ #ifdef _WIN32
Mutex::Mutex()
{
@@ -54,7 +54,7 @@
LeaveCriticalSection(&mutex_.cs_);
}
- #else // WIN32
+ #else // _WIN32
Mutex::Mutex()
{
@@ -80,7 +80,7 @@
}
- #endif // WIN32
+ #endif // _WIN32
#endif // MULTI_THREADED
--- 1.3/extra/yassl/src/log.cpp 2005-05-31 20:56:25 +05:00
+++ 1.4/extra/yassl/src/log.cpp 2005-06-16 16:35:02 +05:00
@@ -78,8 +78,8 @@
}
- #if defined(WIN32) || defined(__MACH__) || defined(__hpux__)
- typedef int socklen_t;
+ #if defined(_WIN32) || defined(__MACH__) || defined(__hpux__)
+ typedef int socklen_t;
#endif
--- 1.3/extra/yassl/src/socket_wrapper.cpp 2005-06-10 20:09:35 +05:00
+++ 1.4/extra/yassl/src/socket_wrapper.cpp 2005-06-16 16:35:02 +05:00
@@ -28,7 +28,7 @@
#include "socket_wrapper.hpp"
-#ifndef WIN32
+#ifndef _WIN32
#include <errno.h>
#include <netdb.h>
#include <unistd.h>
@@ -36,19 +36,19 @@
#include <netinet/in.h>
#include <sys/ioctl.h>
#include <string.h>
-#endif // WIN32
+#endif // _WIN32
#ifdef __sun
#include <sys/filio.h>
#endif
-#ifdef WIN32
+#ifdef _WIN32
const int SOCKET_EINVAL = WSAEINVAL;
const int SOCKET_EWOULDBLOCK = WSAEWOULDBLOCK;
#else
const int SOCKET_EINVAL = EINVAL;
const int SOCKET_EWOULDBLOCK = EWOULDBLOCK;
-#endif // WIN32
+#endif // _WIN32
namespace yaSSL {
@@ -80,7 +80,7 @@
void Socket::closeSocket()
{
if (socket_ != INVALID_SOCKET) {
-#ifdef WIN32
+#ifdef _WIN32
closesocket(socket_);
#else
close(socket_);
@@ -94,7 +94,7 @@
{
unsigned long ready = 0;
-#ifdef WIN32
+#ifdef _WIN32
ioctlsocket(socket_, FIONREAD, &ready);
#else
ioctl(socket_, FIONREAD, &ready);
@@ -145,7 +145,7 @@
int Socket::get_lastError()
{
-#ifdef WIN32
+#ifdef _WIN32
return WSAGetLastError();
#else
return errno;
@@ -155,7 +155,7 @@
void Socket::set_lastError(int errorCode)
{
-#ifdef WIN32
+#ifdef _WIN32
WSASetLastError(errorCode);
#else
errno = errorCode;
--- 1.6/extra/yassl/src/ssl.cpp 2005-06-10 20:09:35 +05:00
+++ 1.7/extra/yassl/src/ssl.cpp 2005-06-16 16:35:02 +05:00
@@ -32,11 +32,11 @@
/* see man pages for function descriptions */
+#include "runtime.hpp"
#include "openssl/ssl.h"
#include "handshake.hpp"
#include "yassl_int.hpp"
#include <stdio.h>
-#include "runtime.hpp"
namespace yaSSL {
--- 1.2/extra/yassl/src/timer.cpp 2005-05-31 20:56:25 +05:00
+++ 1.3/extra/yassl/src/timer.cpp 2005-06-16 16:35:02 +05:00
@@ -27,7 +27,7 @@
namespace yaSSL {
-#ifdef WIN32
+#ifdef _WIN32
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
@@ -54,7 +54,7 @@
return static_cast<uint>(timer());
}
-#else // WIN32
+#else // _WIN32
#include <sys/time.h>
@@ -77,5 +77,5 @@
}
-#endif // WIN32
+#endif // _WIN32
} // namespace yaSSL
--- 1.5/extra/yassl/taocrypt/include/misc.hpp 2005-05-31 20:56:25 +05:00
+++ 1.6/extra/yassl/taocrypt/include/misc.hpp 2005-06-16 16:35:02 +05:00
@@ -30,14 +30,9 @@
#include "types.hpp"
#include "type_traits.hpp"
-/*
-namespace GCC_ABI {
- extern "C" int __cxa_pure_virtual();
-} */
-namespace TaoCrypt {
-// using GCC_ABI::__cxa_pure_virtual;
+namespace TaoCrypt {
// library allocation
struct new_t {}; // TaoCrypt New type
@@ -75,7 +70,7 @@
// to resolve compiler generated operator delete on base classes with
-// virtual destructors, make sure doesn't get called
+// virtual destructors (when on stack), make sure doesn't get called
class virtual_base {
public:
static void operator delete(void*) { assert(0); }
@@ -741,8 +736,6 @@
unsigned int BytePrecision(unsigned long value);
unsigned int BitPrecision(unsigned long);
unsigned long Crop(unsigned long value, unsigned int size);
-
-void CallNewHandler();
--- 1.1/extra/yassl/taocrypt/include/random.hpp 2005-04-28 18:23:16 +05:00
+++ 1.2/extra/yassl/taocrypt/include/random.hpp 2005-06-16 16:35:02 +05:00
@@ -42,7 +42,7 @@
void GenerateSeed(byte*, word32 sz);
Error GetError() const { return error_; }
private:
-#if defined(WIN32)
+#if defined(_WIN32)
#if defined(_WIN64)
typedef unsigned __int64 ProviderHandle;
// type HCRYPTPROV, avoid #include <windows.h>
--- 1.3/extra/yassl/taocrypt/include/types.hpp 2005-06-08 23:58:29 +05:00
+++ 1.4/extra/yassl/taocrypt/include/types.hpp 2005-06-16 16:35:02 +05:00
@@ -80,16 +80,14 @@
#else
#define TAOCRYPT_NATIVE_DWORD_AVAILABLE
#ifdef WORD64_AVAILABLE
- #define TAOCRYPT_SLOW_WORD64
- // define this if your CPU is not64-bit to use alternative code
- // that avoids word64
- typedef word16 hword;
- typedef word32 word;
- typedef word64 dword;
+ #define TAOCRYPT_SLOW_WORD64
+ typedef word16 hword;
+ typedef word32 word;
+ typedef word64 dword;
#else
- typedef byte hword;
- typedef word16 word;
- typedef word32 dword;
+ typedef byte hword;
+ typedef word16 word;
+ typedef word32 dword;
#endif
#endif
--- 1.3/extra/yassl/taocrypt/src/asn.cpp 2005-05-31 20:56:25 +05:00
+++ 1.4/extra/yassl/taocrypt/src/asn.cpp 2005-06-16 16:35:02 +05:00
@@ -22,7 +22,6 @@
/* asn.cpp implements ASN1 BER, PublicKey, and x509v3 decoding
*/
-
#include "runtime.hpp"
#include "asn.hpp"
#include "file.hpp"
--- 1.10/extra/yassl/taocrypt/src/integer.cpp 2005-06-10 20:09:35 +05:00
+++ 1.11/extra/yassl/taocrypt/src/integer.cpp 2005-06-16 16:35:02 +05:00
@@ -23,6 +23,7 @@
/* based on Wei Dai's integer.cpp from CryptoPP */
+#include "runtime.hpp"
#include "integer.hpp"
#include "modarith.hpp"
#include "asn.hpp"
@@ -34,6 +35,21 @@
#endif
+#if defined(_MSC_VER) && defined(_WIN64) // 64 bit X overflow intrinsic
+ #ifdef __ia64__
+ #define myUMULH __UMULH
+ #elif __x86_64__
+ #define myUMULH __umulh
+ #else
+ #error unknown 64bit windows
+ #endif
+
+extern "C" word myUMULH(word, word);
+
+#pragma intrinsic (myUMULH)
+#endif
+
+
#ifdef SSE2_INTRINSICS_AVAILABLE
#ifdef __GNUC__
#include <xmmintrin.h>
@@ -73,16 +89,15 @@
{
void* p;
#ifdef TAOCRYPT_MM_MALLOC_AVAILABLE
- while (!(p = _mm_malloc(sizeof(T)*n, 16)))
+ p = _mm_malloc(sizeof(T)*n, 16);
#elif defined(TAOCRYPT_MEMALIGN_AVAILABLE)
- while (!(p = memalign(16, sizeof(T)*n)))
+ p = memalign(16, sizeof(T)*n);
#elif defined(TAOCRYPT_MALLOC_ALIGNMENT_IS_16)
- while (!(p = malloc(sizeof(T)*n)))
+ p = malloc(sizeof(T)*n);
#else
- while (!(p = (byte *)malloc(sizeof(T)*n + 8)))
+ p = (byte *)malloc(sizeof(T)*n + 8);
// assume malloc alignment is at least 8
#endif
- CallNewHandler();
#ifdef TAOCRYPT_NO_ALIGNED_ALLOC
assert(m_pBlock == 0);
@@ -156,8 +171,14 @@
static DWord Multiply(word a, word b)
{
DWord r;
+
#ifdef TAOCRYPT_NATIVE_DWORD_AVAILABLE
r.whole_ = (dword)a * b;
+
+ #elif defined(_MSC_VER)
+ r.halfs_.low = a*b;
+ r.halfs_.high = myUMULH(a,b);
+
#elif defined(__alpha__)
r.halfs_.low = a*b;
#ifdef __GNUC__
@@ -166,22 +187,27 @@
#elif defined(__DECCXX)
r.halfs_.high = asm("umulh %a0, %a1, %v0", a, b);
#else
- #error can not implement multiply overflow
+ #error unknown alpha compiler
#endif
+
#elif defined(__ia64__)
r.halfs_.low = a*b;
__asm__("xmpy.hu %0=%1,%2" : "=f" (r.halfs_.high)
: "f" (a), "f" (b));
+
#elif defined(_ARCH_PPC64)
r.halfs_.low = a*b;
__asm__("mulhdu %0,%1,%2" : "=r" (r.halfs_.high)
: "r" (a), "r" (b) : "cc");
+
#elif defined(__x86_64__)
__asm__("mulq %3" : "=d" (r.halfs_.high), "=a" (r.halfs_.low) :
"a" (a), "rm" (b) : "cc");
+
#elif defined(__mips64)
__asm__("dmultu %2,%3" : "=h" (r.halfs_.high), "=l" (r.halfs_.low)
: "r" (a), "r" (b));
+
#elif defined(_M_IX86)
// for testing
word64 t = (word64)a * b;
@@ -190,6 +216,7 @@
#else
#error can not implement DWord
#endif
+
return r;
}
@@ -3935,6 +3962,7 @@
#endif
template word DivideThreeWordsByTwo<word, DWord>(word*, word, word, DWord*);
#endif
+
} // namespace
--- 1.6/extra/yassl/taocrypt/src/misc.cpp 2005-06-15 01:39:53 +05:00
+++ 1.7/extra/yassl/taocrypt/src/misc.cpp 2005-06-16 16:35:02 +05:00
@@ -64,10 +64,6 @@
void operator delete[](void* ptr);
*/
-/* namespace GCC_ABI {
- extern "C" int __cxa_pure_virtual() { assert(0); return 0; }
-} */
-
namespace TaoCrypt {
@@ -132,18 +128,6 @@
return (value & ((1L << size) - 1));
else
return value;
-}
-
-
-#if !(defined(_MSC_VER) && (_MSC_VER < 1300)) && \
- !(defined(__HP_aCC) && (__HP_aCC <= 36300))
-using std::new_handler;
-using std::set_new_handler;
-#endif
-
-void CallNewHandler()
-{
- abort();
}
--- 1.3/extra/yassl/taocrypt/src/random.cpp 2005-05-31 20:56:26 +05:00
+++ 1.4/extra/yassl/taocrypt/src/random.cpp 2005-06-16 16:35:02 +05:00
@@ -26,7 +26,7 @@
#include "random.hpp"
-#if defined(WIN32)
+#if defined(_WIN32)
#define _WIN32_WINNT 0x0400
#include <windows.h>
#include <wincrypt.h>
@@ -34,7 +34,7 @@
#include <errno.h>
#include <fcntl.h>
#include <unistd.h>
-#endif // WIN32
+#endif // _WIN32
namespace TaoCrypt {
@@ -64,7 +64,7 @@
}
-#if defined(WIN32)
+#if defined(_WIN32)
OS_Seed::OS_Seed()
{
@@ -87,7 +87,7 @@
}
-#else // WIN32
+#else // _WIN32
OS_Seed::OS_Seed()
@@ -122,7 +122,7 @@
}
}
-#endif // WIN32
+#endif // _WIN32
| Thread |
|---|
| • bk commit into 5.0 tree (svoj:1.1945) | svoj | 16 Jun |