diff qt/QGlobal.d @ 188:7dd099050621

initial commit for D2 support
author eldar
date Sun, 12 Jul 2009 18:58:03 +0000
parents 7d9db724ee1d
children a212c97edcd2
line wrap: on
line diff
--- a/qt/QGlobal.d	Sat Jul 11 11:17:44 2009 +0000
+++ b/qt/QGlobal.d	Sun Jul 12 18:58:03 2009 +0000
@@ -9,9 +9,15 @@
     {
         Stdout(s).newline;
     }
+    package import tango.stdc.stdlib,
+                   tango.core.Memory;
 }
 else
+{
     import std.stdio;
+    package import std.c.stdlib,
+                   core.memory;
+}
 
 template QT_BEGIN_NAMESPACE() {
 }
@@ -586,9 +592,6 @@
 
 mixin QT_END_NAMESPACE;
 
-package import tango.stdc.stdlib,
-               tango.core.Memory;
-
 private
 struct Align
 {
@@ -599,11 +602,6 @@
 private
 const PTR_ALIGN = Align.tupleof[1].alignof;
  
-version( X86 )
-    const MEM_ALIGN = 8u;
-else
-    static assert(false, "Unknown memory alignment for this platform.");
- 
 private
 template AlignPad(size_t base, size_t aligned)
 {
@@ -672,22 +670,6 @@
         const Max = b;
 }
  
-template InstanceSizeAligned(T, size_t alignment=MEM_ALIGN)
-{
-    static if( alignment == 0 )
-        const InstanceSizeAligned = InstanceSize!(T);
-    else
-        const uint InstanceSizeAligned
-            = InstanceSizeAlignImpl!(T, alignment).result;
-}
- 
-private
-template InstanceSizeAlignedImpl(T, size_t alignment)
-{
-    private const base_size = InstanceSize!(T);
-    const result = ((base_size+alignment-1)/alignment)*alignment;
-}
- 
 private
 template InterfaceCount(T)
 {