Fix code gen bug where #directives get copied into generated code leading to compile errors
Fix code gen bug where #directives get copied into generated code leading to compile errors

vbfox/pinvoke,jmelosegui/pinvoke,AArnott/pinvoke