Skip to content

Missing SDL_OpenURL from both wrapper and bindings #1119

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
eigenraven opened this issue Jul 4, 2021 · 2 comments · Fixed by #1138
Closed

Missing SDL_OpenURL from both wrapper and bindings #1119

eigenraven opened this issue Jul 4, 2021 · 2 comments · Fixed by #1138

Comments

@eigenraven
Copy link
Contributor

I'm not familiar enough with bindgen to tell why, but the SDL_OpenURL (added in 2.0.14 according to https://wiki.libsdl.org/SDL_OpenURL) function is missing from sdl2-sys bindings (thus also has no wrapper either)

@Cobrand
Copy link
Member

Cobrand commented Jul 6, 2021

It's missing from the bindings probably because they were generated using 2.0.12 or earlier. 2.0.14 was released in december 2020 (7 months ago), but the bindings were generated 16 months ago.

It's a pretty easy function to add: re-generate the bindings with 2.0.14, then add open_url function somewhere in sdl2.

@JPGygax68
Copy link

I had the same probem and tried your suggestion, but the build fails with the following output:

D:\Source\rust\rust-sdl2>cargo build --features sdl2-sys/bindgen
   Compiling sdl2-sys v0.35.2 (D:\Source\rust\rust-sdl2\sdl2-sys)
   Compiling sdl2 v0.35.2 (D:\Source\rust\rust-sdl2)
error[E0588]: packed type cannot transitively contain a `#[repr(align)]` type
     --> D:\Source\rust\rust-sdl2\target\debug\build\sdl2-sys-2d4fd34169135c1b\out/sdl_bindings.rs:70232:1
      |
70232 | / pub struct _IMAGE_TLS_DIRECTORY64 {
70233 | |     pub StartAddressOfRawData: ULONGLONG,
70234 | |     pub EndAddressOfRawData: ULONGLONG,
70235 | |     pub AddressOfIndex: ULONGLONG,
...     |
70238 | |     pub __bindgen_anon_1: _IMAGE_TLS_DIRECTORY64__bindgen_ty_1,
70239 | | }
      | |_^
      |
note: `_IMAGE_TLS_DIRECTORY64__bindgen_ty_1__bindgen_ty_1` has a `#[repr(align)]` attribute
     --> D:\Source\rust\rust-sdl2\target\debug\build\sdl2-sys-2d4fd34169135c1b\out/sdl_bindings.rs:70250:1
      |
70250 | / pub struct _IMAGE_TLS_DIRECTORY64__bindgen_ty_1__bindgen_ty_1 {
70251 | |     pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize], u32>,
70252 | | }
      | |_^
note: `_IMAGE_TLS_DIRECTORY64` contains a field of type `_IMAGE_TLS_DIRECTORY64__bindgen_ty_1`
     --> D:\Source\rust\rust-sdl2\target\debug\build\sdl2-sys-2d4fd34169135c1b\out/sdl_bindings.rs:70238:9
      |
70238 |     pub __bindgen_anon_1: _IMAGE_TLS_DIRECTORY64__bindgen_ty_1,
      |         ^^^^^^^^^^^^^^^^
note: ...which contains a field of type `_IMAGE_TLS_DIRECTORY64__bindgen_ty_1__bindgen_ty_1`
     --> D:\Source\rust\rust-sdl2\target\debug\build\sdl2-sys-2d4fd34169135c1b\out/sdl_bindings.rs:70244:9
      |
70244 |     pub __bindgen_anon_1: _IMAGE_TLS_DIRECTORY64__bindgen_ty_1__bindgen_ty_1,
      |         ^^^^^^^^^^^^^^^^

For more information about this error, try `rustc --explain E0588`.
error: could not compile `sdl2-sys` due to previous error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants