Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

parsec doesn't generate a symbol when the target of a macro is a field within a union. #619

Closed
dimenus opened this issue Nov 17, 2017 · 0 comments · Fixed by #627
Closed
Labels
enhancement Solving this issue will likely involve adding new logic or components to the codebase.
Milestone

Comments

@dimenus
Copy link
Contributor

dimenus commented Nov 17, 2017

This format is common within OpenGL loaders.

typedef unsigned int GLbitfield;
typedef void (*PFNGLCLEARPROC) (GLbitfield mask);

typedef void(*OpenGLProc)(void);
union OpenGLProcs {
    OpenGLProc ptr[1];
    struct {
        PFNGLCLEARPROC Clear;
    } gl;
};

extern union OpenGLProcs glProcs;
#define glClearUnion glProcs.gl.Clear
#define glClearPFN PFNGLCLEARPROC

zig output:

pub const GLbitfield = c_uint;
pub const PFNGLCLEARPROC = ?extern fn(GLbitfield);
pub const OpenGLProc = ?extern fn();
pub const glClearPFN = PFNGLCLEARPROC;
@andrewrk andrewrk added the enhancement Solving this issue will likely involve adding new logic or components to the codebase. label Nov 17, 2017
@andrewrk andrewrk added this to the 0.2.0 milestone Nov 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Solving this issue will likely involve adding new logic or components to the codebase.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants