Subject: Re: [PATCH v4] libgit-rs: add get_bool(), get_ulong(), and get_pathname() methods

From: Phillip Wood <[email-masked]>
Date: Wed, 8 Oct 2025 14:36:51 +0100

On 06/10/2025 22:20, brian m. carlson wrote:
> On 2025-10-01 at 10:15:28, Phillip Wood wrote:
>> [I've cc'd brian to sanity check my suggestion for handling c_ulong in rust
>> 1.63 which lacks std::ffi::c_ulong]
>>
>> As I said before this wont work because C's ulong type is platform dependent
>> so you cannot assume it 64 bits wide. Looking at the previous discussion[1]
>> the reason we have these fallback definitions is because std::ffi::c_int etc
>> were only added in rust 1.64 and we want to support rust 1.63 as that is the
>> version shipped by Debian oldstable. I think it would be better to have a
>> separate preparatory patch that changes the existing fallbacks to
>>
>> #[cfg(not(has_std__ff__c_char))]
>> use std::os::raw::{c_char, c_int};
>>
>> and then this patch can add "c_ulong" to the list.
> 
> It's just fine to use `std::os::raw` in general without needing to use
> `std::ffi` conditionally.  I'd just default to that until we move away
> from Rust 1.63.  That's what I do myself.

Thanks brian, that sounds much simpler. Lets add a preparatory commit to 
use std::os::raw unconditionally.

Thanks

Phillip