Repository: brendanzab/gl-rs (language: rust)

Issue:
Sound passing of null fn pointers
There are some OpenGL APIs that allow passing of null function pointers: https://github.com/brendanzab/gl-rs/blob/667fbb36c3c629e83d4f7cb15a0e5aad52976051/gl_generator/generators/templates/types/gl.rs#L49 Rust function pointers however, even extern "system" ones, must not be null. Therefore, passing null to them is unsound and recent nightlies are warning about it (see https://github.com/glium/glium/issues/1775).

To fix this, I suggest wrapping an `Option<>` around the fn pointers in those type definitions.


Discussion / hints:
Looks good! I see there is another two function pointers in egl - `EGLSetBlobFuncANDROID` and
`EGLGetBlobFuncANDROID`. Are those nullable too or are we good on that front?
> Are those nullable too or are we good on that front?

Good point, I've had a look:

https://www.khronos.org/registry/EGL/extensions/ANDROID/EGL_ANDROID_blob_cache.txt

> If `<set>` or `<get>` is NULL then an EGL_BAD_PARAMETER error is generated. 

So requiring the fns to be non-null is okay.
Cool thanks a bunch!
@brendanzab Thanks for merging! Could we get a new release? I guess it needs to be 0.14.0 because the API broke.

Fix patch:
diff --git a/gl/Cargo.toml b/gl/Cargo.toml
index f00ccea2..bcd66142 100644
--- a/gl/Cargo.toml
+++ b/gl/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "gl"
-version = "0.13.0"
+version = "0.14.0"
 authors = [
     "Brendan Zabarauskas <bjzaba@yahoo.com.au>",
     "Corey Richardson",
@@ -17,7 +17,7 @@ categories = ["api-bindings", "rendering::graphics-api"]
 keywords = ["gl", "egl", "opengl", "khronos"]
 
 [build-dependencies]
-gl_generator = { version = "0.13.0", path = "../gl_generator" }
+gl_generator = { version = "0.14.0", path = "../gl_generator" }
 
 [dev-dependencies]
 glutin = "0.21.0"
diff --git a/gl_generator/Cargo.toml b/gl_generator/Cargo.toml
index daf569b4..e49ff88c 100644
--- a/gl_generator/Cargo.toml
+++ b/gl_generator/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "gl_generator"
-version = "0.13.1"
+version = "0.14.0"
 authors = [
     "Brendan Zabarauskas <bjzaba@yahoo.com.au>",
     "Corey Richardson",


Test patch: