Change the type of crust fns to `extern "C"` #8666

Closed
wants to merge 3 commits into
from

Conversation

Projects
None yet
6 participants
Contributor

nikomatsakis commented Aug 21, 2013

Change the type of crust fns like this one:

extern fn foo() { ... }

from *u8 to extern "C" fn().

r? @pcwalton (or whomever)

@brendanzab brendanzab commented on the diff Aug 21, 2013

src/librustc/middle/trans/builder.rs
@@ -483,6 +484,7 @@ impl Builder {
debug!("Store %s -> %s",
self.ccx.tn.val_to_str(val),
self.ccx.tn.val_to_str(ptr));
+ assert!(is_not_null(self.llbuilder));
@brendanzab

brendanzab Aug 21, 2013

Member

!self.llbuilder.is_null()?

@huonw huonw commented on the diff Aug 21, 2013

doc/rust.md
~~~
-Extern functions may not be called from Rust code,
-but Rust code may take their value as a raw `u8` pointer.
+Unlike normal functions, extern fns have an `extern "ABI" fn()`.
@huonw

huonw Aug 21, 2013

Owner

Is this sentence basically "unlike normal functions, extern functions have an (explicit?) ABI" or is it meant to be saying something else?

r+

Awesome!

cmr replied Aug 22, 2013

p=10

Contributor

bors replied Aug 22, 2013

saw approval from pcwalton
at nikomatsakis/rust@ffb6404

Contributor

bors replied Aug 22, 2013

merging nikomatsakis/rust/issue-3678-extern-fn-types = ffb6404 into auto

Contributor

bors replied Aug 22, 2013

nikomatsakis/rust/issue-3678-extern-fn-types = ffb6404 merged ok, testing candidate = 4e3dbf9

Contributor

bors replied Aug 22, 2013

fast-forwarding master to auto = 4e3dbf9

@bors bors added a commit that referenced this pull request Aug 22, 2013

@bors bors auto merge of #8666 : nikomatsakis/rust/issue-3678-extern-fn-types, r…
…=pcwalton

Change the type of crust fns like this one:

    extern fn foo() { ... }

from `*u8` to `extern "C" fn()`.

r? @pcwalton (or whomever)
4e3dbf9

bors closed this Aug 22, 2013

@MicahChalmer MicahChalmer added a commit to MicahChalmer/rust-fuse-mc-original that referenced this pull request Aug 27, 2013

@MicahChalmer MicahChalmer Fix the build for rust-lang/rust#8666 61cf284

nikomatsakis deleted the nikomatsakis:issue-3678-extern-fn-types branch Mar 30, 2016

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