dart-lang / dart-lang/native

#ifndef #define pattern - don't generate const

Open
#346 2 comments 0 reactions 0 assignees View on GitHub
package:ffigen
Dominant language
Dart
Stars
275
Forks
144
Avg merge
2d 10h
Merged PRs (30d)
47

Description

```c
#ifndef __GNUC_VA_LIST
#define __GNUC_VA_LIST
! #if defined(__svr4__) || defined(_AIX) || defined(_M_UNIX) || defined(__NetBSD__)
! typedef char *__gnuc_va_list;
! #else
! typedef void *__gnuc_va_list;
! #endif
#endif
```

This generates a `const int __GNUC_VA_LIST = 1;`.

The const is meaningless here, because it's never used as integer.

Workaround:

```yaml
macros:
exclude:
- __GNUC_VA_LIST
```

Could we detect this pattern?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.