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.06k stars 87 forks source link

__char_260 (e.g.) is emitted in referenced projects, results in compilation failure #918

Closed AliveDevil closed 1 year ago

AliveDevil commented 1 year ago

Actual behavior

Expected behavior

CsWin32 shouldn't emit __char_260 in dependent projects, nor create InlineArrayIndexerExtensions, if already exists.

Repro steps

  1. NativeMethods.txt content:

LibA:

SHFILEINFOW

ConsoleB:

DROPDESCRIPTION
  1. NativeMethods.json content (if present):

    {
    "$schema": "https://aka.ms/CsWin32.schema.json",
    "public": true
    }
  2. Any of your own code that should be shared? repro.zip

Context

AArnott commented 1 year ago

Thank you for the excellent report and repro.