Move alignment macros to wdm.h
authorAmine Khaldi <amine.khaldi@reactos.org>
Sat, 27 Feb 2010 14:59:20 +0000 (14:59 +0000)
committerAmine Khaldi <amine.khaldi@reactos.org>
Sat, 27 Feb 2010 14:59:20 +0000 (14:59 +0000)
svn path=/branches/header-work/; revision=45699

include/ddk/wdm.h
include/ddk/winddk.h

index f3f40d7..4517979 100644 (file)
@@ -56,6 +56,22 @@ extern "C" {
 #endif
 
 
 #endif
 
 
+/*
+ * Alignment Macros
+ */
+#define ALIGN_DOWN(s, t) \
+    ((ULONG)(s) & ~(sizeof(t) - 1))
+
+#define ALIGN_UP(s, t) \
+    (ALIGN_DOWN(((ULONG)(s) + sizeof(t) - 1), t))
+
+#define ALIGN_DOWN_POINTER(p, t) \
+    ((PVOID)((ULONG_PTR)(p) & ~((ULONG_PTR)sizeof(t) - 1)))
+
+#define ALIGN_UP_POINTER(p, t) \
+    (ALIGN_DOWN_POINTER(((ULONG_PTR)(p) + sizeof(t) - 1), t))
+
+
 /* Simple types */
 typedef UCHAR KPROCESSOR_MODE;
 typedef LONG KPRIORITY;
 /* Simple types */
 typedef UCHAR KPROCESSOR_MODE;
 typedef LONG KPRIORITY;
index 3c16d90..094efc9 100644 (file)
@@ -74,21 +74,6 @@ extern "C" {
 # define _DDK_DUMMYUNION_N_MEMBER(n, name) name
 #endif
 
 # define _DDK_DUMMYUNION_N_MEMBER(n, name) name
 #endif
 
-/*
- * Alignment Macros
- */
-#define ALIGN_DOWN(s, t) \
-    ((ULONG)(s) & ~(sizeof(t) - 1))
-
-#define ALIGN_UP(s, t) \
-    (ALIGN_DOWN(((ULONG)(s) + sizeof(t) - 1), t))
-
-#define ALIGN_DOWN_POINTER(p, t) \
-    ((PVOID)((ULONG_PTR)(p) & ~((ULONG_PTR)sizeof(t) - 1)))
-
-#define ALIGN_UP_POINTER(p, t) \
-    (ALIGN_DOWN_POINTER(((ULONG_PTR)(p) + sizeof(t) - 1), t))
-
 /*
  * GUID Comparison
  */
 /*
  * GUID Comparison
  */