f87c2c019a16a92a81c05ee5f349fc335edf493c
[reactos.git] / reactos / include / ntdll / ntdll.h
1
2 #include <ntos/ntdef.h>
3
4 #define UNIMPLEMENTED DbgPrint("%s in %s:%d is unimplemented\n",__FUNCTION__,__FILE__,__LINE__);
5
6 #ifndef __USE_W32API
7
8 #ifndef NASSERT
9 #define assert(x) if (!(x)) {DbgPrint("Assertion "#x" failed at %s:%d\n", __FILE__,__LINE__); for(;;);}
10 #else
11 #define assert(x)
12 #endif
13
14 #endif
15
16 #ifdef NDEBUG
17 #if defined(__GNUC__)
18 #define TRACE_LDR(args...) if (NtGlobalFlag & FLG_SHOW_LDR_SNAPS) { DbgPrint("(LDR:%s:%d) ",__FILE__,__LINE__); DbgPrint(args); }
19 #define DPRINT(args...)
20 #else
21 #define DPRINT
22 #endif /* __GNUC__ */
23 #define CHECKPOINT
24 #else
25 #define TRACE_LDR(args...) do { DbgPrint("(LDR:%s:%d) ",__FILE__,__LINE__); DbgPrint(args); } while(0)
26 #define DPRINT(args...) do { DbgPrint("(NTDLL:%s:%d) ",__FILE__,__LINE__); DbgPrint(args); } while(0)
27 #define CHECKPOINT do { DbgPrint("(NTDLL:%s:%d) Checkpoint\n",__FILE__,__LINE__); } while(0)
28 #endif
29
30 #if defined(__GNUC__)
31 #define DPRINT1(args...) do { DbgPrint("(NTDLL:%s:%d) ",__FILE__,__LINE__); DbgPrint(args); } while(0)
32 #else
33 #define DPRINT1 DbgPrint("(NTDLL:%s:%d) ",__FILE__,__LINE__); DbgPrint
34 #endif
35 #define CHECKPOINT1 do { DbgPrint("(NTDLL:%s:%d) Checkpoint\n",__FILE__,__LINE__); } while(0)
36
37 #define ROUNDUP(a,b) ((((a)+(b)-1)/(b))*(b))
38 #define ROUNDDOWN(a,b) (((a)/(b))*(b))
39
40 #define MAGIC(c1,c2,c3,c4) ((c1) + ((c2)<<8) + ((c3)<<16) + ((c4)<<24))
41
42 #define MAGIC_HEAP MAGIC( 'H','E','A','P' )