]> git.lizzy.rs Git - rust.git/commitdiff
extern fns require named parameters
authorAlex Burka <durka42+github@gmail.com>
Tue, 14 Jun 2016 01:10:12 +0000 (21:10 -0400)
committerAlex Burka <aburka@seas.upenn.edu>
Wed, 27 Jul 2016 17:58:51 +0000 (13:58 -0400)
Not sure the example is going to stay, but I can try to pass Travis for the bragging rights.

src/doc/book/ffi.md

index 4a55db38d38149c6d458eb0d68e041ae8488900f..74c99273fa262d017bc50716b59926c295c824c2 100644 (file)
@@ -600,7 +600,7 @@ use std::os::raw::c_int;
 
 extern "C" {
     /// Register the callback.
-    fn register(Option<extern "C" fn(Option<extern "C" fn(c_int) -> c_int>, c_int) -> c_int>);
+    fn register(cb: Option<extern "C" fn(Option<extern "C" fn(c_int) -> c_int>, c_int) -> c_int>);
 }
 
 /// This fairly useless function receives a function pointer and an integer