I'm linking to a C library (OpenGL) and want to use it's functions within Rust. The problem is that the library uses function overloading, and I can't get Rust to accept that.
I can't setup a playground for this, but basically I just want this to compile:
#[link(name = "opengl32")]
extern "C" {
pub fn glEnableVertexAttribArray(index: u32);
pub fn glEnableVertexAttribArray(index: u32, vaobj: u32);
}
This gives me back
error[E0428]: the name `glEnableVertexAttribArray` is defined multiple times
--> src\main.rs:74:5
|
73 | pub fn glEnableVertexAttribArray(index: u32);
| --------------------------------------------- previous definition of the value `glEnableVertexAttribArray` here
74 | pub fn glEnableVertexAttribArray(index: u32, vaobj: u32);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `glEnableVertexAttribArray` redefined here
|
= note: `glEnableVertexAttribArray` must be defined only once in the value namespace of this module
error: aborting due to previous error
What is the best way around this?