5a4004f658bbff4a46e30924658fa86dc28be9e5
[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 #define ASSERT(x) if (!(x)) {DbgPrint("Assertion "#x" failed at %s:%d\n", __FILE__,__LINE__); for(;;);}
11 #else
12 #define assert(x)
13 #define ASSERT(x)
14 #endif
15
16 #endif
17
18 #ifdef NDEBUG
19 #if defined(__GNUC__)
20 #define TRACE_LDR(args...) if (RtlGetNtGlobalFlags() & FLG_SHOW_LDR_SNAPS) { DbgPrint("(LDR:%s:%d) ",__FILE__,__LINE__); DbgPrint(args); }
21 #define DPRINT(args...)
22 #else
23 #define DPRINT
24 #endif /* __GNUC__ */
25 #define CHECKPOINT
26 #else
27 #define TRACE_LDR(args...) do { DbgPrint("(LDR:%s:%d) ",__FILE__,__LINE__); DbgPrint(args); } while(0)
28 #define DPRINT(args...) do { DbgPrint("(NTDLL:%s:%d) ",__FILE__,__LINE__); DbgPrint(args); } while(0)
29 #define CHECKPOINT do { DbgPrint("(NTDLL:%s:%d) Checkpoint\n",__FILE__,__LINE__); } while(0)
30 #endif
31
32 #if defined(__GNUC__)
33 #define DPRINT1(args...) do { DbgPrint("(NTDLL:%s:%d) ",__FILE__,__LINE__); DbgPrint(args); } while(0)
34 #else
35 #define DPRINT1 DbgPrint("(NTDLL:%s:%d) ",__FILE__,__LINE__); DbgPrint
36 #endif
37 #define CHECKPOINT1 do { DbgPrint("(NTDLL:%s:%d) Checkpoint\n",__FILE__,__LINE__); } while(0)
38
39 #define ROUNDUP(a,b) ((((a)+(b)-1)/(b))*(b))
40 #define ROUNDDOWN(a,b) (((a)/(b))*(b))
41
42 #define MAGIC(c1,c2,c3,c4) ((c1) + ((c2)<<8) + ((c3)<<16) + ((c4)<<24))
43
44 #define MAGIC_HEAP MAGIC( 'H','E','A','P' )
45
46 #ifdef DBG
47 extern VOID FASTCALL CHECK_PAGED_CODE_RTL(char *file, int line);
48 #define PAGED_CODE_RTL() CHECK_PAGED_CODE_RTL(__FILE__, __LINE__)
49 #else
50 #define PAGED_CODE_RTL()
51 #endif