Skip to content

Support "eponymous" macros  #1155

@jorisdral

Description

@jorisdral

From: #991 (comment)

These macro "newtypes" redefine an existing identifier as a macro, but the macro simply desugars to the pre-exesting identifier. Such cases exis in the wild, for example in stdio.h:

typedef int FILE;

extern FILE *const stdin;
extern FILE *const stdout;
extern FILE *const stderr;

#define stdin  (stdin)
#define stdout (stdout)
#define stderr (stderr)

The current behaviour of hs-bindgen is to not generate a binding and emit a "redeclaration" trace message. Should hs-bindgen instead allow this corner-case of a redeclared identifier, and generate a binding for the non-macro declaration?

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestongoingIssues currently actively being worked on.priority: low

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions