Neat-Lang / neat

The Neat Language compiler. Early beta?
BSD 3-Clause "New" or "Revised" License
111 stars 9 forks source link

Allow scoped extern(C) declarations #64

Open rsaarelm opened 6 months ago

rsaarelm commented 6 months ago

This lets you write FFI functions like

void foo() {  // Neat function in module namespace
  extern(C) void foo();  // C function with same name in wrapper implementation namespace
  ...
}
FeepingCreature commented 6 months ago

Yeah extern(C)s should really be declarations probably. That whole piece of compiler machinery was added after extern declarations, which is why you can declare structs in a function but not externs.