Commits

Kaya Kupferschmidt committed f07e93b

Fixed timezones on Windows XP
Fixed Function object for VS 7.1
Removed Delegate

Comments (0)

Files changed (17)

source/libs/magnum_core/magnum_core.files

 source/magnum/object/ConvertChecker.h
 source/magnum/object/CowReference.h
 source/magnum/object/CustomVariant.h
-source/magnum/object/Delegate.h
 source/magnum/object/Disposable.h
 source/magnum/object/DllExport.h
 source/magnum/object/Error.cpp

source/libs/magnum_core/source/magnum/base.h

 #include "magnum/object/Number.h"
 #include "magnum/object/Any.h"
 #include "magnum/object/cast.h"
-#include "magnum/object/Delegate.h"
 #include "magnum/object/Invocation.h"
 #include "magnum/object/Invokable.h"
 #include "magnum/object/Variant.h"

source/libs/magnum_core/source/magnum/container/Stack.h

     inline void remove(size_t n) {
         ASSERT(m_Stack.getSize() >= n);
         Iterator end = m_Stack.end();
-        Iterator first = end - n;
+        Iterator first = end - typename Iterator::DifferenceType(n);
         m_Stack.remove(first, end);
     }
 						

source/libs/magnum_core/source/magnum/datetime/TimeZone.cpp

 #include "magnum/datetime/spi/TimeZoneProvider.h"
 
 #if defined(__FORWINDOWS__)
+#   include "magnum/system/win32/Exception.h"
 #   include "magnum/system/win32/Registry.h"
 #endif
 
+#include <locale.h>
+
 
 namespace {
 using magnum::types::String;
 using magnum::types::Character;
 using magnum::object::Reference;
+using magnum::object::Array;
 using magnum::object::Variant;
 using magnum::datetime::TimeZone;
 using magnum::datetime::SimpleTimeZone;
 }
 
 
+#if defined(__FORWINDOWS__)
+namespace {
+using magnum::types::String;
+
+
+String getWindowsTimeZoneXP()
+{
+    String standardName;
+    magnum::system::win32::Registry reg(magnum::system::win32::Registry::LocalMachine);
+    try {
+        standardName = reg.getString("SYSTEM\\CurrentControlSet\\Control\\TimeZoneInformation", "StandardName");
+    }
+    catch(...) {
+        return String();
+    }
+
+    // Enumerate all zone names    
+    Array<String> zonenames;
+    String zonetree = "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Time Zones";
+    try {
+        zonenames = reg.getNodeNames(zonetree);
+    }
+    catch(...) {
+        return String();
+    }
+
+    // Find correct time zone
+    String wintzName;
+    for (int i = 0; i < (int)zonenames.getSize(); i++) {
+        String zonenode = zonetree + '\\' + zonenames[i];
+
+        try {
+            String tzName = reg.getString(zonenode, "Std");
+            if (tzName == standardName) {
+                wintzName = zonenames[i];
+                break;
+            }
+        }
+        catch(...) {
+        }
+    }
+
+    return wintzName;
+}
+
+String getWindowsTimeZoneVista()
+{
+    magnum::system::win32::Registry reg(magnum::system::win32::Registry::LocalMachine);
+    try {
+        return reg.getString("SYSTEM\\CurrentControlSet\\Control\\TimeZoneInformation", "TimeZoneKeyName");
+    }
+    catch(const magnum::system::win32::RegistryValueNotFoundException& ) {
+        return String();
+    }
+}
+
+String getWindowsTimeZone()
+{
+	// Windows 7 stores the timezone name in a different key from earlier Windows releases
+    OSVERSIONINFO osversioninfo;
+	osversioninfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
+	GetVersionEx(&osversioninfo);
+
+    String wintzName;
+	if (osversioninfo.dwMajorVersion >=6) {
+	    wintzName = getWindowsTimeZoneVista();
+	}
+	else {
+	    wintzName = getWindowsTimeZoneXP();
+	}
+	
+    // Fallback
+    String tzName = TimeZone::lookupWindowsZone(wintzName);
+    if (tzName.isEmpty())
+        tzName = wintzName;
+        
+    return tzName;
+}
+
+}
+#endif
+
+
 namespace magnum { namespace datetime {
 using magnum::object::Nil;
 using magnum::types::index_t;
 {
     if (!m_SystemTimeZone) {
 #if defined(__FORWINDOWS__)
-        magnum::system::win32::Registry reg(magnum::system::win32::Registry::LocalMachine);
-        String wintzName = reg.getString("SYSTEM\\CurrentControlSet\\Control\\TimeZoneInformation", "TimeZoneKeyName");
-        String tzName = lookupWindowsZone(wintzName);
-        if (tzName.isEmpty())
-            tzName = wintzName;
+        String tzName = getWindowsTimeZone();
 #else
         String tzName = ::setlocale(LC_ALL, NULL);
 #endif

source/libs/magnum_core/source/magnum/object/Delegate.h

-/* 
-  Magnum 
-  Copyright (C) 2002-2013 Kaya Kupferschmidt. All Rights Reserved.
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, under the terms in LICENSE.TXT.
-
-  Kaya Kupferschmidt  (k.kupferschmidt@dimajix.de)
-*/
-
-#ifndef __MAGNUM_OBJECT_DELEGATE_H
-#define __MAGNUM_OBJECT_DELEGATE_H
-
-#include "magnum/object/traits/CallTraits.h"
-#include "magnum/object/Object.h"
-
-
-namespace magnum { namespace object {
-using magnum::types::byte;
-using magnum::types::traits::CallTraits;
-
-
-/*--------------------------------------------------------------------------*/
-/**
- */
-template<class R,class A1=void,class A2=void,class A3=void>
-class Delegate {
-public:
-    typedef R       ReturnType;
-    typedef typename CallTraits<A1>::ArgumentType ArgumentType1;
-    typedef typename CallTraits<A2>::ArgumentType ArgumentType2;
-    typedef typename CallTraits<A3>::ArgumentType ArgumentType3;
-
-public:
-    inline Delegate()
-    {
-    }
-    inline Delegate(R (*fn)(A1 ,A2 ,A3 ))
-    {
-       delegate_function_stub::init(*this, fn);
-    }
-    template<class T>
-    inline Delegate(T* obj, R (T::*method)(A1 ,A2 ,A3 ))
-    {
-       m_Object = obj;
-       delegate_method_stub<T>::init(*this, method);
-    }
-
-    inline R operator()(ArgumentType1 a1, ArgumentType2 a2, ArgumentType3 a3) const
-    {
-       return (*m_Stub)(*this, a1,a2,a3);
-    }
-
-private:
-	typedef R (*Stub)(const Delegate<R,A1,A2,A3>&,ArgumentType1,ArgumentType2,ArgumentType3);
-	
-	void*		m_Object;
-	Stub		m_Stub;
-	union {
-	    R       (*m_Function)(A1,A2);
-	    byte    m_Method[6*sizeof(void*)];
-	};
-	
-	template<class T>
-	struct delegate_method_stub {
-	    typedef R (T::*MethodType)(A1,A2,A3);
-	    static void init(Delegate<R,A1,A2,A3>& dg,MethodType t) {
-	        new(dg.m_Method) MethodType(t);
-	        dg.m_Stub = &stub;
-	    }
-	    static R stub(const Delegate<R,A1,A2,A3>& dg,ArgumentType1 a1,ArgumentType2 a2,ArgumentType3 a3) {
-            T* p = static_cast<T*>(dg.m_Object);
-            const MethodType method = *reinterpret_cast<const MethodType*>(dg.m_Method);
-            return (p->*method)(a1,a2,a3);
-        }
-   	};
-   	
-	struct delegate_function_stub {
-	    typedef R (*FunctionType)(A1,A2,A3);
-	    static void init(Delegate<R,A1,A2,A3>& dg,FunctionType t) {
-	        dg.m_Function = t;
-	        dg.m_Stub = &stub;
-	    }
-       	static R stub(const Delegate<R,A1,A2,A3>& dg,ArgumentType1 a1,ArgumentType2 a2,ArgumentType3 a3) {
-       	    return (*dg.m_Function)(a1,a2,a3);
-        }
-    };
-    
-    template<class T> friend struct delegate_method_stub;
-    friend struct delegate_function_stub;
-};
-
-
-/*--------------------------------------------------------------------------*/
-/**
- */
-template<class R,class A1,class A2>
-class Delegate<R,A1,A2,void> {
-public:
-    typedef R       ReturnType;
-    typedef typename CallTraits<A1>::ArgumentType ArgumentType1;
-    typedef typename CallTraits<A2>::ArgumentType ArgumentType2;
-
-public:
-    inline Delegate()
-    {
-    }
-    inline Delegate(R (*fn)(A1 ,A2 ))
-    {
-       delegate_function_stub::init(*this, fn);
-    }
-    template<class T>
-    inline Delegate(T* obj, R (T::*method)(A1 ,A2 ))
-    {
-       m_Object = obj;
-       delegate_method_stub<T>::init(*this, method);
-    }
-    inline R operator()(ArgumentType1 a1, ArgumentType2 a2) const
-    {
-       return (*m_Stub)(*this, a1, a2);
-    }
-
-private:
-	typedef R (*Stub)(const Delegate<R,A1,A2>&,ArgumentType1,ArgumentType2);
-	
-	void*		m_Object;
-	Stub		m_Stub;
-	union {
-	    R       (*m_Function)(A1,A2);
-	    byte    m_Method[6*sizeof(void*)];
-	};
-	
-	template<class T>
-	struct delegate_method_stub {
-	    typedef R (T::*MethodType)(A1,A2);
-	    static void init(Delegate<R,A1,A2>& dg,MethodType t) {
-	        new(dg.m_Method) MethodType(t);
-	        dg.m_Stub = &stub;
-	    }
-	    static R stub(const Delegate<R,A1,A2>& dg,ArgumentType1 a1,ArgumentType2 a2) {
-            T* p = static_cast<T*>(dg.m_Object);
-            const MethodType method = *reinterpret_cast<const MethodType*>(dg.m_Method);
-            return (p->*method)(a1,a2);
-        }
-   	};
-   	
-	struct delegate_function_stub {
-	    typedef R (*FunctionType)(A1,A2);
-	    static void init(Delegate<R,A1,A2>& dg,FunctionType t) {
-	        dg.m_Function = t;
-	        dg.m_Stub = &stub;
-	    }
-       	static R stub(const Delegate<R,A1,A2>& dg,ArgumentType1 a1,ArgumentType2 a2) {
-       	    return (*dg.m_Function)(a1,a2);
-        }
-    };
-    
-    template<class T> friend struct delegate_method_stub;
-    friend struct delegate_function_stub;
-};
-
-
-/*--------------------------------------------------------------------------*/
-/**
- */
-template<class R,class A1>
-class Delegate<R,A1,void,void> {
-public:
-    typedef R       ReturnType;
-    typedef typename CallTraits<A1>::ArgumentType ArgumentType1;
-    
-public:
-    inline Delegate()
-    {
-    }
-    inline Delegate(R (*fn)(A1))
-    {
-       delegate_function_stub::init(*this, fn);
-    }
-    template<class T>
-    inline Delegate(T* obj, R (T::*method)(A1))
-    {
-       m_Object = obj;
-       delegate_method_stub<T>::init(*this, method);
-    }
-
-    inline R operator()(ArgumentType1 a1) const
-    {
-       return (*m_Stub)(*this, a1);
-    }
-
-private:
-	typedef R (*Stub)(const Delegate<R,A1>& ,ArgumentType1);
-	
-	void*		m_Object;
-	Stub		m_Stub;
-	union {
-	    R       (*m_Function)(A1);
-	    byte    m_Method[6*sizeof(void*)];
-	};
-	
-	template<class T>
-	struct delegate_method_stub {
-	    typedef R (T::*MethodType)(A1);
-	    static void init(Delegate<R,A1>& dg,MethodType t) {
-	        new(dg.m_Method) MethodType(t);
-	        dg.m_Stub = &stub;
-	    }
-	    static R stub(const Delegate<R,A1>& dg,ArgumentType1 a1) {
-            T* p = static_cast<T*>(dg.m_Object);
-            const MethodType method = *reinterpret_cast<const MethodType*>(dg.m_Method);
-            return (p->*method)(a1);
-        }
-   	};
-   	
-	struct delegate_function_stub {
-	    typedef R (*FunctionType)(A1);
-	    static void init(Delegate<R,A1>& dg,FunctionType t) {
-	        dg.m_Function = t;
-	        dg.m_Stub = &stub;
-	    }
-       	static R stub(const Delegate<R,A1>& dg,ArgumentType1 a1) {
-       	    return (*dg.m_Function)(a1);
-        }
-    };
-    
-    template<class T> friend struct delegate_method_stub;
-    friend struct delegate_function_stub;
-};
-
-
-/*--------------------------------------------------------------------------*/
-/**
- */
-template<class R>
-class Delegate<R,void,void,void> {
-public:
-    inline Delegate()
-    {
-    }
-    inline Delegate(R (*fn)())
-    {
-       delegate_function_stub::init(*this, fn);
-    }
-	template<class T>
-    inline Delegate(T* obj, R (T::*method)())
-    {
-       m_Object = obj;
-       delegate_method_stub<T>::init(*this, method);
-    }
-	
-    inline R operator()() const
-    {
-       return (*m_Stub)(*this);
-    }
-	
-private:
-	typedef R (*Stub)(const Delegate<R>&);
-	
-	void*		m_Object;
-	Stub		m_Stub;
-	union {
-	    R       (*m_Function)();
-	    byte    m_Method[6*sizeof(void*)];
-	};
-	
-	template<class T>
-	struct delegate_method_stub {
-	    typedef R (T::*MethodType)();
-	    static void init(Delegate<R>& dg,MethodType t) {
-	        new(dg.m_Method) MethodType(t);
-	        dg.m_Stub = &stub;
-	    }
-	    static R stub(const Delegate<R>& dg) {
-            T* p = static_cast<T*>(dg.m_Object);
-            const MethodType method = *reinterpret_cast<const MethodType*>(dg.m_Method);
-            return (p->*method)();
-        }
-   	};
-   	
-	struct delegate_function_stub {
-	    typedef R (*FunctionType)();
-	    static void init(Delegate<R>& dg,FunctionType t) {
-	        dg.m_Function = t;
-	        dg.m_Stub = &stub;
-	    }
-       	static R stub(const Delegate<R>& dg) {
-       	    return (*dg.m_Function)();
-        }
-    };
-    
-    template<class T> friend struct delegate_method_stub;
-    friend struct delegate_function_stub;
-};
-
-}; };
-
-#endif

source/libs/magnum_core/source/magnum/object/Function.h

         : super(functor)
     {
     }
+    template<class F>
+    inline Function(F* functor)
+        : super(functor)
+    {
+    }
     template<class O, class F>
     inline Function(O* obj, const F& functor)
         : super(obj, functor)
         : super(static_cast<const super&>(other)) { } \
     template<class F> inline Function(const F& functor) \
         : super(functor) { } \
+    template<class F> inline Function(F* functor) \
+        : super(functor) { } \
     template<class O, class F> inline Function(O* obj, const F& functor) \
         : super(obj, functor) { }
 

source/libs/magnum_core/source/magnum/object/Function_base.inl

     {
         init_fun(functor, typename FunctionTypeSelector<F>::Type());
     }
+    template<class F>
+    inline TypedFunctionBase(F* functor)
+    {
+        init_fun(*functor, typename FunctionTypeSelector<F>::Type());
+    }
     template<class O, class F>
     inline TypedFunctionBase(O* obj, const F& functor)
     {

source/libs/magnum_core/source/magnum/object/platform/intrinsics.h

 	long  __cdecl _InterlockedIncrement(long volatile *Addend);
 	long  __cdecl _InterlockedDecrement(long volatile *Addend);
 	long  __cdecl _InterlockedCompareExchange(long volatile* Dest, long Exchange, long Comp);
-	long  __cdecl _InterlockedExchange(long volatile* Target, long Value);
+    long  __cdecl _InterlockedAdd(long volatile *Addend, long Value);
+    long  __cdecl _InterlockedExchange(long volatile* Target, long Value);
 	long  __cdecl _InterlockedExchangeAdd(long volatile* Addend, long Value);
 	#if _MSC_VER >= 1400
     	short  __cdecl _InterlockedIncrement16(short volatile *Addend);
 	    short  __cdecl _InterlockedDecrement16(short volatile *Addend);
 	#endif
 	#if defined(_M_IA64) || defined(_M_X64)
-    	__int64  __cdecl _InterlockedIncrement64(__int64 volatile *Addend);
+        __int64  __cdecl _InterlockedAdd64(__int64 volatile *Addend, __int64 Value);
+        __int64  __cdecl _InterlockedIncrement64(__int64 volatile *Addend);
 	    __int64  __cdecl _InterlockedDecrement64(__int64 volatile *Addend);
 	#endif
 	}
 	#pragma intrinsic (_InterlockedExchange)
 	#define InterlockedExchange _InterlockedExchange 
 
-	#pragma intrinsic (_InterlockedExchangeAdd)
+    #pragma intrinsic (_InterlockedExchangeAdd)
 	#define InterlockedExchangeAdd _InterlockedExchangeAdd
 
 	#pragma intrinsic (_InterlockedIncrement)
 	#define InterlockedDecrement _InterlockedDecrement
 
 	#if _MSC_VER >= 1400
-	#   pragma intrinsic (_InterlockedIncrement16)
+    #   pragma intrinsic (_InterlockedAdd)
+    #   pragma intrinsic (_InterlockedIncrement16)
 	#   pragma intrinsic (_InterlockedDecrement16)
 	#endif
 
 	#if defined(_M_IA64) || defined(_M_X64)
-	#   pragma intrinsic (_InterlockedIncrement64)
+    #   pragma intrinsic (_InterlockedAdd64)
+    #   pragma intrinsic (_InterlockedIncrement64)
 	#   pragma intrinsic (_InterlockedDecrement64)
 	#endif
 #endif

source/libs/magnum_core/source/magnum/object/sys/atomic.win.h

 
     static inline T add(volatile T& value, T other)
     {
-        return (T)InterlockedAdd((volatile LONG*)&value, other);
+        return (T)InterlockedAdd((volatile LONG*)&value, (LONG)other);
     }
     static inline T sub(volatile T& value, T other)
     {
-        return (T)InterlockedAdd((volatile LONG*)&value, -other);
+        return (T)InterlockedAdd((volatile LONG*)&value, (LONG)-other);
     }
     static inline T fetch_add(volatile T& value, T other)
     {
-        T old = value;
-        InterlockedAdd((volatile LONG*)&value, other);
-        return old;
+        return (T)InterlockedExchangeAdd((volatile LONG*)&value, (LONG)other);
     }
     static inline T fetch_sub(volatile T& value, T other)
     {
-        T old = value;
-        InterlockedAdd((volatile LONG*)&value, -other);
-        return old;
+        return (T)InterlockedExchangeAdd((volatile LONG*)&value, (LONG)-other);
     }
 
     static inline T swap(volatile T& value, T exchange)
 
     static inline T add(volatile T& value, T other)
     {
-        return (T)InterlockedAdd64((volatile LONGLONG*)&value, other);
+        return (T)InterlockedAdd64((volatile LONGLONG*)&value, (LONGLONG)other);
     }
     static inline T sub(volatile T& value, T other)
     {
-        return (T)InterlockedAdd64((volatile LONGLONG*)&value, -other);
+        return (T)InterlockedAdd64((volatile LONGLONG*)&value, (LONGLONG)-other);
     }
     static inline T fetch_add(volatile T& value, T other)
     {
-        T old = value;
-        InterlockedAdd64((volatile LONGLONG*)&value, other);
-        return old;
+        return (T)InterlockedExchangeAdd64((volatile LONGLONG*)&value, (LONGLONG)other);
     }
     static inline T fetch_sub(volatile T& value, T other)
     {
-        T old = value;
-        InterlockedAdd64((volatile LONGLONG*)&value, -other);
-        return old;
+        return (T)InterlockedExchangeAdd64((volatile LONGLONG*)&value, (LONGLONG)-other);
     }
 
     static inline T swap(volatile T& value, T exchange)

source/libs/magnum_test/source/magnum/test/Macros.h

 /* 
   Magnum 
-  Copyright (C) 2002-2009 Kaya Kupferschmidt. All Rights Reserved.
+  Copyright (C) 2002-2013 Kaya Kupferschmidt. All Rights Reserved.
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
 /**
  */
 #define TEST_ADD(testname) \
-    addTest(magnum::object::Delegate<void>(this, &testname), #testname);
+    addTest(magnum::object::Function<void>(this, &testname), #testname);
 	
 } }
 

source/libs/magnum_test/source/magnum/test/StdTestSuite.cpp

 /*--------------------------------------------------------------------------*/
 /**
  */
-void StdTestSuite::addTest(const Delegate<void>& deleg, const String& name)
+void StdTestSuite::addTest(const Function<void>& deleg, const String& name)
 {
     m_Tests.insert(Test(deleg, name));
 }

source/libs/magnum_test/source/magnum/test/StdTestSuite.h

 #define __MAGNUM_TEST_STDTESTSUITE_H
 
 #include "magnum/object/Reference.h"
-#include "magnum/object/Delegate.h"
+#include "magnum/object/Function.h"
 #include "magnum/object/Array.h"
 #include "magnum/logging/Logable.h"
 #include "magnum/test/ListResult.h"
 namespace magnum { namespace test {
 using magnum::logging::Logable;
 using magnum::logging::Logger;
-using magnum::object::Delegate;
+using magnum::object::Function;
 
 
 /*--------------------------------------------------------------------------*/
     virtual void setLogger(Logger* );
 	
 protected:
-    void addTest(const Delegate<void>& , const String& name);
+    void addTest(const Function<void>& , const String& name);
     void log_failure(const char* file, int line, const String& msg);    	
     void log_success(const char* file, int line, const String& msg);
 	String stripFile(const char* );
 	
 private:
     struct Test {
-        Test(const Delegate<void>& del, const String& n) : executor(del), name(n) { }; 
-        Delegate<void> executor;
+        Test(const Function<void>& del, const String& n)
+            : executor(del), name(n) { }
+        Function<void> executor;
         String name;
     };
     String m_CurrentTest;

source/libs/magnum_text/source/magnum/text/FloatFormat_writer.h

         char* buffer = ecvt(value, Limits<ValueType>::decimals + 1, &dcpt, &sign);
 #endif
         char* str = buffer;
-        size_t digits = StringTraits<const char*>::getLength(str);
+        int digits = (int)StringTraits<const char*>::getLength(str);
 
         // Create result string
         if (sign)
         }
 
         // Check if we need to do some rounding
-        if (dcpt + maxPrecision < (int)digits) {
+        if (dcpt + maxPrecision < digits) {
             bool overflow = roundBuffer(str, max(0,dcpt + maxPrecision)) > 0;
             if (overflow) {
                 dcpt--;
 
         // Remove trailing zeros
         else if (digits > dcpt) {
-            removeZeros(str + dcpt, min(maxPrecision,(int)digits - dcpt));
+            removeZeros(str + dcpt, min(maxPrecision,digits - dcpt));
         }
         
         // Special case: No characters left, print zero

source/unittest/object/Test_Atomic.h

         thread->start();
         threads.insert(thread);
     }
-    for (int i = 0; i < threads.getSize(); i++)
+    for (int i = 0; i < numThreads; i++)
     {
         threads[i]->join();
     }
     TEST_ASSERT(atom == 0);
 }
 
+
+void test_atomic_int()
+{
+    test_atomic_incdec<Atomic<int> >();
+}
+void test_atomic_long()
+{
+    test_atomic_incdec<Atomic<long> >();
+}
+void test_atomic_uint()
+{
+    test_atomic_incdec<Atomic<unsigned int> >();
+}
+void test_atomic_ulong()
+{
+    test_atomic_incdec<Atomic<unsigned long> >();
+}
+void test_atomic_atom()
+{
+    test_atomic_incdec<core_atom>();
+}
+
 Test_Atomic()
 {
+#if defined(MG_CC_MSVC71)
+    TEST_ADD( Test_Atomic::test_atomic_int );
+    TEST_ADD( Test_Atomic::test_atomic_uint );
+    TEST_ADD( Test_Atomic::test_atomic_long );
+    TEST_ADD( Test_Atomic::test_atomic_ulong );
+    TEST_ADD( Test_Atomic::test_atomic_atom );
+#else
     TEST_ADD( Test_Atomic::test_atomic_incdec<Atomic<int> > );
     TEST_ADD( Test_Atomic::test_atomic_incdec<Atomic<long> > );
+    //TEST_ADD( Test_Atomic::test_atomic_incdec<Atomic<long long> > );
     TEST_ADD( Test_Atomic::test_atomic_incdec<Atomic<unsigned int> > );
     TEST_ADD( Test_Atomic::test_atomic_incdec<Atomic<unsigned long> > );
+    //TEST_ADD( Test_Atomic::test_atomic_incdec<Atomic<unsigned long long> > );
     TEST_ADD( Test_Atomic::test_atomic_incdec<core_atom> );
-
     TEST_ADD( Test_Atomic::test_atomic_incdec_ptr<Atomic<float*> > );
-
     TEST_ADD( Test_Atomic::test_atomic_incdec_short<Atomic<short> > );
     TEST_ADD( Test_Atomic::test_atomic_incdec_ushort<Atomic<unsigned short> > );
+#endif
+
 }
 
 };

source/unittest/object/Test_Delegate.h

-/* 
-  Magnum 
-  Copyright (C) 2002-2009 Kaya Kupferschmidt. All Rights Reserved.
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, under the terms in LICENSE.TXT.
-
-  Kaya Kupferschmidt  (k.kupferschmidt@dimajix.de)
-*/
-
-#include "magnum/base.h"
-#include "magnum/system.h"
-#include "magnum/test.h"
-
-using magnum::types::String;
-using magnum::object::Object;
-using magnum::object::Delegate;
-using magnum::object::Delegate;
-
-class MethodDelegateTestClass {
-public:
-    int         m_value;
-    
-    void        resetValue() {m_value = 0; };
-    void        setValue(int v) { m_value = v; };
-};
-static int functionDelegateTest_value = 0;
-void FunctionDelegateTest_reset() {
-    functionDelegateTest_value = 0;
-}
-void FunctionDelegateTest_set(int value) {
-    functionDelegateTest_value = value;
-}
-
-
-class Test_Delegate : public magnum::test::StdTestSuite {
-
-void test_function_delegates() {
-    TEST_ASSERT(functionDelegateTest_value == 0);
-    
-    Delegate<void> d0(&FunctionDelegateTest_reset);
-    functionDelegateTest_value = 1;
-    TEST_ASSERT(functionDelegateTest_value == 1);
-    d0();
-    TEST_ASSERT(functionDelegateTest_value == 0);
-    
-    Delegate<void,int> d1(&FunctionDelegateTest_set);
-    functionDelegateTest_value = 1;
-    TEST_ASSERT(functionDelegateTest_value == 1);
-    d1(7);
-    TEST_ASSERT(functionDelegateTest_value == 7);
-};
-
-
-void test_method_delegates() {
-    MethodDelegateTestClass object;
-    
-    Delegate<void> d0(&object,&MethodDelegateTestClass::resetValue);
-    object.m_value = 1;
-    TEST_ASSERT(object.m_value == 1);
-    d0();
-    TEST_ASSERT(object.m_value == 0);
-    
-    Delegate<void,int> d1(&object,&MethodDelegateTestClass::setValue);
-    object.m_value = 1;
-    TEST_ASSERT(object.m_value == 1);
-    d1(7);
-    TEST_ASSERT(object.m_value == 7);
-};
-
-void run(void) {
-	test_function_delegates();
-	test_method_delegates();
-}
-
-};
-

source/unittest/object/main.cpp

 /* 
   Magnum 
-  Copyright (C) 2002-2012 Kaya Kupferschmidt. All Rights Reserved.
+  Copyright (C) 2002-2013 Kaya Kupferschmidt. All Rights Reserved.
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
 #include "Test_Uuid.h"
 #include "Test_Pointer.h"
 #include "Test_Function.h"
-#include "Test_Delegate.h"
 #include "Test_Conversion.h"
 #include "Test_Limits.h"
 #include "Test_Invocation.h"
     runner.insertTestSuite(new Test_StringUtils());
     runner.insertTestSuite(new Test_UUID());
     runner.insertTestSuite(new Test_Pointer());
-    runner.insertTestSuite(new Test_Delegate());
     runner.insertTestSuite(new Test_Function());
     runner.insertTestSuite(new Test_Conversion());
     runner.insertTestSuite(new Test_Limits());

source/unittest/unittest.files

 object/Test_ByteArray.h
 object/Test_Conversion.h
 object/Test_CString.h
-object/Test_Delegate.h
 object/Test_GlobalGuard.h
 object/Test_Invocation.h
 object/Test_Limits.h