Skip to content

Commit

Permalink
Merge pull request #354 from mike-kfed/arm-cross-compile
Browse files Browse the repository at this point in the history
use platform dependent c_char instead of hardcoded i8
  • Loading branch information
Dirreke authored Jan 29, 2025
2 parents 373192d + 7213ae8 commit af2e191
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions lax/src/flags.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//! Charactor flags, e.g. `'T'`, used in LAPACK API
use core::ffi::c_char;

/// Upper/Lower specification for seveal usages
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
Expand All @@ -17,8 +18,8 @@ impl UPLO {
}

/// To use Fortran LAPACK API in lapack-sys crate
pub fn as_ptr(&self) -> *const i8 {
self as *const UPLO as *const i8
pub fn as_ptr(&self) -> *const c_char {
self as *const UPLO as *const c_char
}
}

Expand All @@ -32,8 +33,8 @@ pub enum Transpose {

impl Transpose {
/// To use Fortran LAPACK API in lapack-sys crate
pub fn as_ptr(&self) -> *const i8 {
self as *const Transpose as *const i8
pub fn as_ptr(&self) -> *const c_char {
self as *const Transpose as *const c_char
}
}

Expand All @@ -55,8 +56,8 @@ impl NormType {
}

/// To use Fortran LAPACK API in lapack-sys crate
pub fn as_ptr(&self) -> *const i8 {
self as *const NormType as *const i8
pub fn as_ptr(&self) -> *const c_char {
self as *const NormType as *const c_char
}
}

Expand Down Expand Up @@ -87,8 +88,8 @@ impl JobEv {
}

/// To use Fortran LAPACK API in lapack-sys crate
pub fn as_ptr(&self) -> *const i8 {
self as *const JobEv as *const i8
pub fn as_ptr(&self) -> *const c_char {
self as *const JobEv as *const c_char
}
}

Expand Down Expand Up @@ -117,8 +118,8 @@ impl JobSvd {
}
}

pub fn as_ptr(&self) -> *const i8 {
self as *const JobSvd as *const i8
pub fn as_ptr(&self) -> *const c_char {
self as *const JobSvd as *const c_char
}
}

Expand All @@ -133,7 +134,7 @@ pub enum Diag {
}

impl Diag {
pub fn as_ptr(&self) -> *const i8 {
self as *const Diag as *const i8
pub fn as_ptr(&self) -> *const c_char {
self as *const Diag as *const c_char
}
}

0 comments on commit af2e191

Please sign in to comment.