Re: [Pyobjc-dev] Can't bridge UCConvertUTCDateTimeToCFAbsoluteTime
Brought to you by:
ronaldoussoren
|
From: blake <ch...@ap...> - 2007-11-26 20:17:15
|
> I am trying to bridge UCConvertUTCDateTimeToCFAbsoluteTime using
> PyObjC in Leopard.
>
> The problem that I am running into is that
> UCConvertUTCDateTimeToCFAbsoluteTime takes a struct that's declared
> (on 32 bits) as {unsigned short; unsigned long; unsigned short;} using
> packed alignment, which means that the offset of the 4-byte long
> member is 2. When I use {UTCDateTime=SLS}, PyObjC puts the 4-byte long
> at offset 4, which then causes problems down the line.
>
> Looking at PyObjC source, I don't see a way to force custom alignment
> of struct members.
>
> Did I miss some mechanism for handling this? What are my option?
> Thanks,
>
> Ben
The problem appears to be that no metadata exists for <CarbonCore/
UTCUtils.h>. You might try running gen_bridge_metadata(1) on
CarbonCore.framework, or typecast UTCDateTime to int64_t instead.
Blake Chaffin |