Opentk/Source/OpenTK.Rewrite
Stefanos A 6ccab1784f Use StdCall calling convention by default
It appears that calli callsites cannot be decorated with the
“platformapi” calling convention like DllImport signatures can. This is
problematic since Windows uses stdcall by default and most other
platforms use cdecl.

There are three approaches to this issue, without going back to
delegate calls: (a) generate an unmanaged thunk that cleans up the
stack after a GL call; (b) use libFFI; (c) use cdecl *or* stdcall
everywhere and hope that the runtime can cope.

.Net 2.0 can detect and fix stdcall functions invoked through a cdecl
callsite. .Net 4.0 adds a configuration option to enable or disable
this fixup (faster p/invoke if disabled) and raise a MDA exception when
this condition is detected. (This affects x86 only.)

Mono appears to be able to cope with cdecl functions invoked through a
stdcall callsite.

More testing is required.
2013-12-01 21:25:03 +01:00
..
Dependencies Build 3.5 profile with Visual Studio 2013-11-27 08:28:39 +01:00
Properties Implemented dll rewriter using Mono.Cecil 2013-11-25 00:19:54 +01:00
OpenTK.Rewrite.csproj Protect against multiple runs; optimize il 2013-11-26 19:06:39 +01:00
Program.cs Use StdCall calling convention by default 2013-12-01 21:25:03 +01:00