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

declare_gl_apis! macros doesn't allow us to add default function implementations #229

Open
jamienicol opened this issue Apr 21, 2023 · 0 comments

Comments

@jamienicol
Copy link
Contributor

For #228, I would have liked to add default (empty) implementations of the newly added functions. This would be nice because a) the extension I'm exposing is GLES-only, so does not need a GlFns implementation. And b) currently every time we expose a new API to the Gl trait it's a breaking change and we have to bump the semver, and in gecko we need to add an impl to our swgl trait, even when it won't be used.

Unfortunately, trying to add a default impl currently results in a compilation error due to the declare_gl_apis macro:

error: no rules expected the token `{`
   --> src/gl.rs:765:113
    |
81  | macro_rules! declare_gl_apis {
    | ---------------------------- when calling this macro
...
765 |     fn start_tiling_qcom(&self, x: GLuint, y: GLuint, width: GLuint, height: GLuint, preserve_mask: GLbitfield) {
    |                                                                                                                 ^ no rules expected this token in macro call
    |
note: while trying to match `;`
   --> src/gl.rs:83:106
    |
83  |     ($($(unsafe $([$garbo:expr])*)* fn $name:ident(&self $(, $arg:ident: $t:ty)* $(,)*) $(-> $retty:ty)* ;)+) => {
    |
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant