 +#endif
 +
  }
+diff -ur a/src/big_ops2.cpp b/src/big_ops2.cpp
+--- a/src/big_ops2.cpp	2007-03-24 11:51:37.000000000 -0700
++++ b/src/big_ops2.cpp	2007-06-26 11:31:30.000000000 -0700
+@@ -19,7 +19,11 @@
+    {
+    const u32bit x_sw = sig_words(), y_sw = y.sig_words();
+ 
++#ifdef BOTAN_TYPES_QT
++   const u32bit reg_size = qMax(x_sw, y_sw) + 1;
++#else
+    const u32bit reg_size = std::max(x_sw, y_sw) + 1;
++#endif
+    grow_to(reg_size);
+ 
+    if((sign() == y.sign()))
+@@ -56,7 +60,11 @@
+ 
+    s32bit relative_size = bigint_cmp(data(), x_sw, y.data(), y_sw);
+ 
++#ifdef BOTAN_TYPES_QT
++   const u32bit reg_size = qMax(x_sw, y_sw) + 1;
++#else
+    const u32bit reg_size = std::max(x_sw, y_sw) + 1;
++#endif
+    grow_to(reg_size);
+ 
+    if(relative_size < 0)
+diff -ur a/src/big_ops3.cpp b/src/big_ops3.cpp
+--- a/src/big_ops3.cpp	2007-03-24 11:51:37.000000000 -0700
++++ b/src/big_ops3.cpp	2007-06-26 11:31:30.000000000 -0700
+@@ -18,7 +18,11 @@
+    {
+    const u32bit x_sw = x.sig_words(), y_sw = y.sig_words();
+ 
++#ifdef BOTAN_TYPES_QT
++   BigInt z(x.sign(), qMax(x_sw, y_sw) + 1);
++#else
+    BigInt z(x.sign(), std::max(x_sw, y_sw) + 1);
++#endif
+ 
+    if((x.sign() == y.sign()))
+       bigint_add3(z.get_reg(), x.data(), x_sw, y.data(), y_sw);
+@@ -49,7 +53,11 @@
+ 
+    s32bit relative_size = bigint_cmp(x.data(), x_sw, y.data(), y_sw);
+ 
++#ifdef BOTAN_TYPES_QT
++   BigInt z(BigInt::Positive, qMax(x_sw, y_sw) + 1);
++#else
+    BigInt z(BigInt::Positive, std::max(x_sw, y_sw) + 1);
++#endif
+ 
+    if(relative_size < 0)
+       {
 diff -ur a/src/charset.cpp b/src/charset.cpp
 --- a/src/charset.cpp	2007-03-24 11:51:37.000000000 -0700
-+++ b/src/charset.cpp	2007-04-19 14:22:32.000000000 -0700
-@@ -4,8 +4,12 @@
++++ b/src/charset.cpp	2007-06-26 11:31:30.000000000 -0700
+@@ -4,10 +4,15 @@
  *************************************************/
  
  #include <botan/charset.h>

 
 }
 
diff -ur a/include/numthry.h b/include/numthry.h
--- a/include/numthry.h	2007-03-24 11:51:37.000000000 -0700
+++ b/include/numthry.h	2007-04-19 14:21:54.000000000 -0700
@@ -7,11 +7,14 @@
 #define BOTAN_NUMBTHRY_H__
 

    }
 
 /*************************************************
 * Library_State Destructor                       *
 *************************************************/
+static void delete_lock(std::pair<const std::string, Mutex*> &pair)
+   {
+   delete pair.second;
+   }
+
 Library_State::~Library_State()
    {
+#ifndef BOTAN_TOOLS_ONLY
    delete x509_state_obj;
    delete transcoder;
    delete rng;
@@ -381,6 +421,7 @@
    std::for_each(entropy_sources.begin(), entropy_sources.end(),
                  del_fun<EntropySource>());
    std::for_each(engines.begin(), engines.end(), del_fun<Engine>());
