winapi-rs icon indicating copy to clipboard operation
winapi-rs copied to clipboard

Vtbl call convention for C++

Open lassade opened this issue 3 years ago • 0 comments

In some cenarios (like when c isn't supported for one reason or the other) its useful having the c++ call conventions in vtbl.

going from this:

pub struct ID3D12DescriptorHeapVtbl {
    // ...
    pub GetCPUDescriptorHandleForHeapStart:
        unsafe extern "system" fn(
            This: *mut ID3D12DescriptorHeap,
            ret: *mut D3D12_CPU_DESCRIPTOR_HANDLE,
        ) -> *mut D3D12_CPU_DESCRIPTOR_HANDLE,
    // ...
}

to this

pub struct ID3D12DescriptorHeapVtbl {
    // ...
    pub GetCPUDescriptorHandleForHeapStart:
        unsafe extern "system" fn(This: *mut ID3D12DescriptorHeap) -> D3D12_CPU_DESCRIPTOR_HANDLE,
    // ...
}

It also looks like the c vs c++ call convention was fixed in the Windows 10 SDK 10.0.20348.0 source here;

This funcion could be behind a feature;

Sadly I can't explain the actual reason why, because reasons;

lassade avatar Oct 28 '21 17:10 lassade