Use nuint instead of IntPtr for size/length parameters.

This commit is contained in:
Rolf Bjarne Kvinge 2018-08-01 02:12:14 +02:00
Родитель 2f5e14434f
Коммит e04d7fdf9d
1 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -39,14 +39,14 @@ namespace Network {
}
[DllImport (Constants.NetworkLibrary)]
static extern void nw_advertise_descriptor_set_txt_record (IntPtr handle, string txtRecord, IntPtr txtLen);
static extern void nw_advertise_descriptor_set_txt_record (IntPtr handle, string txtRecord, nuint txtLen);
public void SetTxtRecord (string txt)
{
if (txt == null)
throw new ArgumentNullException (nameof (txt));
var n = System.Text.Encoding.UTF8.GetByteCount (txt);
nw_advertise_descriptor_set_txt_record (GetHandle (), txt, (IntPtr) n);
nw_advertise_descriptor_set_txt_record (GetHandle (), txt, (nuint) n);
}
[DllImport (Constants.NetworkLibrary)]