[w32file] Move MonoIO.Find{First,Next,Close} to managed
[mono.git] / mcs / tests / test-473.cs
1 using System;
2 using System.Runtime.InteropServices;
3
4 [Obsolete ("Use Errno", true)]
5 public enum Error {
6         EROFS,
7         ERANGE = TestConst.C,
8         EANOTHER = ERANGE,
9 }
10
11 public enum Error_2 {
12         [Obsolete ("Use A", true)]
13         ERANGE,
14         [Obsolete ("Use B", true)]
15         EANOTHER = ERANGE,
16 }
17
18
19 [Obsolete ("Use Native.SignalHandler", true)]
20 public delegate void SignalHandler (int signal);
21
22 [Obsolete ("Use Errno", true)]
23 public sealed class UnixMarshal {
24
25         public static readonly SignalHandler SIG_DFL = new SignalHandler(Default);
26
27         static UnixMarshal ()
28         {
29                 Stdlib s = new Stdlib ();
30         }
31         
32         private static void Default (int signal)
33         {
34         }
35
36         public static string GetDescription (Error e) {
37                 return null;
38         }
39 }
40
41 public sealed class UnixMarshal2 {
42         [Obsolete ("Use Errno", true)]
43         public static string GetDescription (Error e) {
44                 return null;
45         }
46 }
47
48 [Obsolete ("Use Native.Stdlib", true)]
49 public class Stdlib {
50         
51         enum E {
52                 val1 = TestConst.C
53         }
54         
55         internal const string LIBC = "msvcrt.dll";
56         [DllImport (LIBC)]
57         public static extern IntPtr signal (int signum, IntPtr handler);
58 }
59
60 class TestConst {
61         [Obsolete ("B", true)]
62         public const int C = 3;
63 }
64
65
66 [Obsolete ("Use Native.Stdlib", true)]
67 public class XX {
68         private static readonly SignalHandler[] registered_signals;
69 }
70
71 [Obsolete ("Use Native.Pollfd", true)]
72 public struct Pollfd {
73 }
74
75 [Obsolete ("Use Native.Syscall", true)]
76 public class Syscall : XX {
77         public static int poll (Pollfd [] fds, uint nfds, int timeout) {
78                 return -1;
79         }
80 }
81
82
83 [Obsolete ("test me", true)]
84 partial struct PS
85 {
86 }
87
88 partial struct PS
89 {
90         [Obsolete ("Use Errno", true)]
91         public static void GetDescription (Error e) {}
92 }
93
94
95 [Obsolete ("Replaced by direct enum type casts to/from GLib.Value", true)]
96 public class EnumWrapper {
97         public EnumWrapper (int val)
98         {
99         }
100 }       
101
102 public struct Value 
103 {
104         [Obsolete ("Replaced by Enum cast", true)]
105         public static explicit operator EnumWrapper (Value val)
106         {
107                 return new EnumWrapper (334455);
108         }
109 }
110
111 class Test {
112         public static void Main () {
113         }
114 }