pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: {pkgsrc-users} need help with C# -- how to deal with different time_t widths?



Hi Brian -

bsd%cs.ubc.ca@localhost said:
> > The appended patch
> You didn't append a patch.

Yes, as always... I had posted it a couple of minutes later.

> The lower-case are the primitive types, and
> the System.* are their corresponding classes; C# will automatically
> box/unbox them as necessary.

What would be the advantage of using classes for integers?
Passing integers by reference doesn't sound very efficient.
(But anyway, since my problem is about modeling a C data
structure in C# I guess that simple types are the way to go.)

> #if TIMET_IS_32BITS
>       UInt32 blah;
> #else
>       UInt64 blah;
> #endif

Thanks - this works.
Unfortunately, the assumption that time_t fits into a pointer
is also in exported interfaces of the underlying gtk-sharp
library, so I needed some typecasts to compensate.
I think a better fix would be to make the type used for
time_t a 64-bit integer throughout the code, but that
would be an interface change.
Could you please have a look at pkgsrc/x11/gnome-sharp and
check that my fix is correct?

best regards
Matthias



------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------
Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzende des Aufsichtsrats: MinDir'in Baerbel Brumme-Bothe
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Dr. Ulrich Krafft (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt
------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------


Home | Main Index | Thread Index | Old Index