# Make translate-c more robust in handling macro functions\. · gitcafe/zig

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

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

Visibility: public

Requested revision: fbb297fd2a666eca9c89b2afce7464abcc7daeec

Requested commit: fbb297fd2a666eca9c89b2afce7464abcc7daeec

Commit: fbb297fd2a666eca9c89b2afce7464abcc7daeec

Tree: 4082d67260b544120fbd3be2b9d487002386e8bb

Author: Matthew Roush

Committer: Alex Rønne Petersen

## Message

```
Make translate-c more robust in handling macro functions.

Translate-c didn't properly account for C macro functions having parameter names that are C keywords. So something like `#define FOO(float) ((float) + 10)` would've been interpreted as casting `+10` to a `float` type, instead of adding `10` to the parameter `float`.

An example of a real-world macro function like this is SDL3's `SDL_DEFINE_AUDIO_FORMAT` from `SDL_audio.h`, which uses `signed` as a parameter.
```

## Parents

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

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