depmaker
[tridge/junkcode.git] / ntstatus.c
1 #include <stdio.h>
2
3 typedef unsigned uint32;
4 typedef unsigned BOOL;
5
6
7 #ifdef __GNUC__
8 typedef struct {uint32 v;} NTSTATUS;
9 #define NT_STATUS(x) ((NTSTATUS) { x })
10 #define NT_STATUS_V(x) ((x).v)
11 #else
12 typedef uint32 NTSTATUS;
13 #define NT_STATUS(x) (x)
14 #define NT_STATUS_V(x) (x)
15 #endif
16
17 BOOL bar(NTSTATUS x)
18 {
19         return x;
20 }
21
22 NTSTATUS foo(void)
23 {
24         return NT_STATUS(3);
25 }
26
27 int main()
28 {
29         NTSTATUS x;
30         
31         x = foo();
32         bar(1);
33
34         printf("%d\n", NT_STATUS_V(x));
35         return 0;
36 }