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

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

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

Visibility: public

Requested revision: 06fc600aec227f00d1edbb0b1577b26e490c7d8c

Requested commit: 06fc600aec227f00d1edbb0b1577b26e490c7d8c

Commit: 06fc600aec227f00d1edbb0b1577b26e490c7d8c

Tree: 01e983ffab2f600d24292c9ea60612fdac770fcd

Author: Parker Liu

Committer: Alex Rønne Petersen

## 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

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

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