Skip to content

Commit eefb8c6

Browse files
committed
Make new_array_type take u64
1 parent 1bd270d commit eefb8c6

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

gccjit_sys/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
extern crate libc;
44

5-
use libc::{c_char, c_int, FILE, c_void, c_long, c_double, size_t, ssize_t};
5+
use libc::{c_char, c_int, FILE, c_void, c_long, c_double, c_ulong, size_t, ssize_t};
66

77
// opaque pointers
88
pub enum gcc_jit_context {}
@@ -344,7 +344,7 @@ extern {
344344
pub fn gcc_jit_context_new_array_type(ctx: *mut gcc_jit_context,
345345
loc: *mut gcc_jit_location,
346346
ty: *mut gcc_jit_type,
347-
num_elements: c_int) -> *mut gcc_jit_type;
347+
num_elements: c_ulong) -> *mut gcc_jit_type;
348348
// struct handling
349349
pub fn gcc_jit_context_new_field(ctx: *mut gcc_jit_context,
350350
loc: *mut gcc_jit_location,

src/context.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use std::ops::Drop;
33
use std::ffi::{CStr, CString};
44
use std::marker::PhantomData;
55
use std::mem;
6-
use std::os::raw::c_int;
6+
use std::os::raw::{c_int, c_ulong};
77
use std::ptr;
88
use std::str::Utf8Error;
99

@@ -403,7 +403,7 @@ impl<'ctx> Context<'ctx> {
403403
pub fn new_array_type<'a>(&'a self,
404404
loc: Option<Location<'a>>,
405405
ty: types::Type<'a>,
406-
num_elements: i32) -> types::Type<'a> {
406+
num_elements: u64) -> types::Type<'a> {
407407
let loc_ptr = match loc {
408408
Some(loc) => unsafe { location::get_ptr(&loc) },
409409
None => ptr::null_mut()
@@ -412,7 +412,7 @@ impl<'ctx> Context<'ctx> {
412412
let ptr = gccjit_sys::gcc_jit_context_new_array_type(self.ptr,
413413
loc_ptr,
414414
types::get_ptr(&ty),
415-
num_elements);
415+
num_elements as c_ulong);
416416
#[cfg(debug_assertions)]
417417
if let Ok(Some(error)) = self.get_last_error() {
418418
panic!("{}", error);

0 commit comments

Comments
 (0)