mirror of
https://git.freebsd.org/ports.git
synced 2025-07-18 01:39:16 -04:00
misc/py-pyqir: fix build on ARM / POWER
char on ARM / POWER is unsigned.
This commit is contained in:
parent
04dca06cef
commit
f9f98dc284
1 changed files with 32 additions and 0 deletions
32
misc/py-pyqir/files/patch-qirlib_src_qis.rs
Normal file
32
misc/py-pyqir/files/patch-qirlib_src_qis.rs
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
--- qirlib/src/qis.rs.orig 2023-07-30 20:03:41 UTC
|
||||||
|
+++ qirlib/src/qis.rs
|
||||||
|
@@ -1,6 +1,8 @@
|
||||||
|
// Copyright (c) Microsoft Corporation.
|
||||||
|
// Licensed under the MIT License.
|
||||||
|
|
||||||
|
+use std::os::raw::c_char;
|
||||||
|
+
|
||||||
|
use crate::{
|
||||||
|
builder::{build_if, try_build_if},
|
||||||
|
types,
|
||||||
|
@@ -194,7 +196,7 @@ unsafe fn mz(module: LLVMModuleRef) -> LLVMValueRef {
|
||||||
|
|
||||||
|
let function = declare_qis(module, "mz", Functor::Body, ty);
|
||||||
|
let attr_name = "writeonly";
|
||||||
|
- let kind_id = LLVMGetEnumAttributeKindForName(attr_name.as_ptr().cast::<i8>(), attr_name.len());
|
||||||
|
+ let kind_id = LLVMGetEnumAttributeKindForName(attr_name.as_ptr().cast::<c_char>(), attr_name.len());
|
||||||
|
let attr = LLVMCreateEnumAttribute(context, kind_id, 0);
|
||||||
|
let result_param_index = 2; // indices are 1 based.
|
||||||
|
LLVMAddAttributeAtIndex(function, result_param_index, attr);
|
||||||
|
@@ -208,9 +210,9 @@ unsafe fn add_irreversible_attr(context: LLVMContextRe
|
||||||
|
let irreversable = "irreversible";
|
||||||
|
let irreversable_attr = LLVMCreateStringAttribute(
|
||||||
|
context,
|
||||||
|
- irreversable.as_ptr().cast::<i8>(),
|
||||||
|
+ irreversable.as_ptr().cast::<c_char>(),
|
||||||
|
irreversable.len() as u32,
|
||||||
|
- "".as_ptr().cast::<i8>(),
|
||||||
|
+ "".as_ptr().cast::<c_char>(),
|
||||||
|
0,
|
||||||
|
);
|
||||||
|
LLVMAddAttributeAtIndex(function, LLVMAttributeFunctionIndex, irreversable_attr);
|
Loading…
Add table
Reference in a new issue