Bug 1453551 - Don't use i8 as c_char in xpcom-gtest. r=mystor
authorMakoto Kato <m_kato@ga2.so-net.ne.jp>
Thu, 12 Apr 2018 15:28:08 +0900
changeset 467510 4c40ad65f4724f1e647002dc0f84b6b71cae5f50
parent 467509 c85fefa9248cf393873f8abff5e6d3a3ce65de81
child 467511 00c968ee4e0c02b8491dfb4c905c862a34ccb94e
push id9165
push userasasaki@mozilla.com
push dateThu, 26 Apr 2018 21:04:54 +0000
treeherdermozilla-beta@064c3804de2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmystor
bugs1453551
milestone61.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1453551 - Don't use i8 as c_char in xpcom-gtest. r=mystor c_char isn't i8 on some platforms such as Android/arm, so we should use c_char instead. MozReview-Commit-ID: 486BCGvYAE0
xpcom/rust/gtest/xpcom/test.rs
--- a/xpcom/rust/gtest/xpcom/test.rs
+++ b/xpcom/rust/gtest/xpcom/test.rs
@@ -4,16 +4,17 @@
 
 #![allow(non_snake_case)]
 
 #[macro_use]
 extern crate xpcom;
 
 extern crate nserror;
 
+use std::os::raw::c_char;
 use std::ptr;
 use std::ffi::{CStr, CString};
 use xpcom::interfaces;
 use nserror::{NsresultExt, nsresult, NS_OK};
 
 #[no_mangle]
 pub unsafe extern fn Rust_ObserveFromRust() -> *const interfaces::nsIObserverService {
     let obssvc = xpcom::services::get_ObserverService().unwrap();
@@ -24,17 +25,17 @@ pub unsafe extern fn Rust_ObserveFromRus
     #[refcnt = "nonatomic"]
     struct InitObserver {
         run: *mut bool
     }
     impl Observer {
         unsafe fn Observe(
             &self,
             _subject: *const interfaces::nsISupports,
-            topic: *const i8,
+            topic: *const c_char,
             _data: *const i16
         ) -> nsresult {
             *self.run = true;
             assert!(CStr::from_ptr(topic).to_str() == Ok("test-rust-observe"));
             NS_OK
         }
     }