move rand functions into c-stack-cdecl mode

This commit is contained in:
Niko Matsakis 2011-10-20 11:09:21 -07:00 committed by Brian Anderson
parent 35e01e0137
commit 96629d5c21
2 changed files with 11 additions and 1 deletions

View File

@ -4,7 +4,7 @@
/**
* Bindings the runtime's random number generator (ISAAC).
*/
native "rust" mod rustrt {
native "c-stack-cdecl" mod rustrt {
type rctx;
fn rand_new() -> rctx;
fn rand_next(c: rctx) -> u32;

View File

@ -160,12 +160,22 @@ rand_new() {
}
extern "C" CDECL size_t
<<<<<<< HEAD
rand_next(randctx *rctx) {
=======
rand_next(randctx *rctx)
{
>>>>>>> move rand functions into c-stack-cdecl mode
return isaac_rand(rctx);
}
extern "C" CDECL void
<<<<<<< HEAD
rand_free(randctx *rctx) {
=======
rand_free(randctx *rctx)
{
>>>>>>> move rand functions into c-stack-cdecl mode
rust_task *task = rust_scheduler::get_task();
task->free(rctx);
}