Skip to content

ogc-sys: no bindings generated for static inline methods #7

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

Closed
TomSmeets opened this issue Jul 25, 2020 · 2 comments · Fixed by #8
Closed

ogc-sys: no bindings generated for static inline methods #7

TomSmeets opened this issue Jul 25, 2020 · 2 comments · Fixed by #8
Assignees
Labels
bug Something isn't working

Comments

@TomSmeets
Copy link

In the process of trying to convert the triangle example from https://github.com/devkitPro/wii-examples/blob/master/graphics/gx/triangle/source/triangle.c to rust I noticed that multiple methods including GX_End() where missing from ogc-sys.
All these methods are static inline methods in libogc/include/ogc/gx.h

These methods should somehow be directly converted to rust because they are not exported.
Note that GX_End() doesn't actually do anything at all. And the other methods are very simple.

A relevant issue in rust-bindgen is rust-lang/rust-bindgen#1090

All inline methods in gx.h
$ grep '^static inline' $DEVKITPRO/libogc/include/ogc/gx.h
static inline void GX_End(void)
static inline void GX_Position3f32(f32 x,f32 y,f32 z)
static inline void GX_Position3u16(u16 x,u16 y,u16 z)
static inline void GX_Position3s16(s16 x,s16 y,s16 z)
static inline void GX_Position3u8(u8 x,u8 y,u8 z)
static inline void GX_Position3s8(s8 x,s8 y,s8 z)
static inline void GX_Position2f32(f32 x,f32 y)
static inline void GX_Position2u16(u16 x,u16 y)
static inline void GX_Position2s16(s16 x,s16 y)
static inline void GX_Position2u8(u8 x,u8 y)
static inline void GX_Position2s8(s8 x,s8 y)
static inline void GX_Position1x8(u8 index)
static inline void GX_Position1x16(u16 index)
static inline void GX_Normal3f32(f32 nx,f32 ny,f32 nz)
static inline void GX_Normal3s16(s16 nx,s16 ny,s16 nz)
static inline void GX_Normal3s8(s8 nx,s8 ny,s8 nz)
static inline void GX_Normal1x8(u8 index)
static inline void GX_Normal1x16(u16 index)
static inline void GX_Color4u8(u8 r,u8 g,u8 b,u8 a)
static inline void GX_Color3u8(u8 r,u8 g,u8 b)
static inline void GX_Color3f32(f32 r, f32 g, f32 b)
static inline void GX_Color1u32(u32 clr)
static inline void GX_Color1u16(u16 clr)
static inline void GX_Color1x8(u8 index)
static inline void GX_Color1x16(u16 index)
static inline void GX_TexCoord2f32(f32 s,f32 t)
static inline void GX_TexCoord2u16(u16 s,u16 t)
static inline void GX_TexCoord2s16(s16 s,s16 t)
static inline void GX_TexCoord2u8(u8 s,u8 t)
static inline void GX_TexCoord2s8(s8 s,s8 t)
static inline void GX_TexCoord1f32(f32 s)
static inline void GX_TexCoord1u16(u16 s)
static inline void GX_TexCoord1s16(s16 s)
static inline void GX_TexCoord1u8(u8 s)
static inline void GX_TexCoord1s8(s8 s)
static inline void GX_TexCoord1x8(u8 index)
static inline void GX_TexCoord1x16(u16 index)
static inline void GX_MatrixIndex1x8(u8 index)
@FrictionlessPortals FrictionlessPortals added the bug Something isn't working label Jul 25, 2020
@FrictionlessPortals FrictionlessPortals self-assigned this Jul 25, 2020
@FrictionlessPortals
Copy link
Contributor

Interesting, will have to go through and see if any other functions were affected by this issue.

Implementing the mentioned functions in libogc/include/ogc/gx.h seems simple enough. Those functions should probably be made unsafe or have safety documentation instructing the user of what happens.

@FrictionlessPortals
Copy link
Contributor

These functions have been implemented into ogc-sys as of PR #8.

Feel free to reopen this issue if any error occurs when using the implemented functions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants