microsoft / CsWin32

A source generator to add a user-defined set of Win32 P/Invoke methods and supporting types to a C# project.
MIT License
2.1k stars 90 forks source link

Null-coalescing in friendly overload #848

Closed davidegiacometti closed 1 year ago

davidegiacometti commented 1 year ago

Fixes #277 Use null-coalescing in friendly overload. Generate x ?? default(TYPE) instead of x.HasValue ? x.Value : default(TYPE).