Skip to content
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

Introduce a ThrowTypeError function. #72

Closed
wants to merge 1 commit into from
Closed

Conversation

@Ms2ger
Copy link
Collaborator

Ms2ger commented Apr 19, 2014

No description provided.

@jdm
Copy link
Member

jdm commented Apr 20, 2014

Why does all this need to be in C++? It all looks like code that could either live in the Rust side or even in bindings/utils.rs.

@Ms2ger
Copy link
Collaborator Author

Ms2ger commented Apr 20, 2014

Do you have a way to put a *c_char in a static struct?

@jdm
Copy link
Member

jdm commented Apr 20, 2014

static cstr: [u8, ..3] = ['h' as u8, 'i' as u8, 0];
static whatever: CStruct = CStruct { thing: &cstr as *u8 as *c_char };
@Ms2ger
Copy link
Collaborator Author

Ms2ger commented Apr 20, 2014

That's not scarier than the C++ at all :)

@jdm
Copy link
Member

jdm commented Apr 20, 2014

It can be slightly improved by cstr being [c_char, ..3], but yeah. I'd prefer to keep this in Rust code, regardless.

@jdm
Copy link
Member

jdm commented Apr 20, 2014

We could also write a procedural macro like static_cstr!("hi"). It wouldn't be a huge undertaking, but would probably make rustc upgrades slightly more painful.

@jdm jdm closed this Apr 23, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.