blob: e6e71099ac0b178adde0315a8234f3b50a6f669c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
// Compiler options: -unsafe
using System;
using System.Runtime.InteropServices;
namespace NObjective
{
public class Program
{
static volatile bool ProcessExiting = false;
[DllImport ("libc.dylib")]
public extern static void printf (string format, __arglist);
private static void ArglistMethod (__arglist)
{
var iter = new ArgIterator (__arglist);
for (int n = iter.GetRemainingCount (); n > 0; n--)
Console.WriteLine (TypedReference.ToObject (iter.GetNextArg ()));
}
static unsafe void Main (string[] args)
{
ArglistMethod (__arglist (1, 2, 3));
}
}
}
|