# translate-c: fix function prototype decalared inside a function · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/de62dc884edb1205e1aac799e0a3b4273be999a1)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: de62dc884edb1205e1aac799e0a3b4273be999a1

Requested commit: de62dc884edb1205e1aac799e0a3b4273be999a1

Commit: de62dc884edb1205e1aac799e0a3b4273be999a1

Tree: a422d9b06ad72ce6d13cca7015fe4091b707faac

Author: Parker Liu

Committer: GitHub

## Message

```
translate-c: fix function prototype decalared inside a function

* If a function prototype is declarated inside a function, do not
  translate it to a top-level extern function declaration. Similar to
  extern local variable, just wrapped it into a block-local struct.

* Add a new extern_local_fn tag of aro_translate_c node for present
  extern local function declaration.

* When a function body has a C function prototype declaration, it adds
  an extern local function declaration. Subsequent function references
  will look for this function declaration.
```

## Parents

- [9dfdf3503242428f93c56c8f211834bd6b87ac76](https://git.cafe/gitcafe/zig/commit/9dfdf3503242428f93c56c8f211834bd6b87ac76?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/de62dc884edb1205e1aac799e0a3b4273be999a1?format=markdown)
