Re: [Vala] Extended floating types



error: structs cannot be empty: float128_t

On Tue, May 24, 2016 at 11:16 AM Al Thomas <astavale yahoo co uk> wrote:




------------------------------
*From:* ben <iofelben gmail com>
*Sent:* Tuesday, 24 May 2016, 16:01
*Subject:* Re: [Vala] Extended floating types


This does not work. The C code has: typedef float float128_t;

Try:

[SimpleType]
[CCode(has_type_id = false, default_value = "0")]
public struct float128_t {}

The SimplyType makes it be passed by value rather than by reference when
used
as an argument in a function call.
I think the FloatingType, IntegerType, etc. does casting. As there is no
rank 12 it just casts to the default, i.e. float.

On the subject of binding exotic types. Bindings for C decimal types
would be useful for financial data and transactions.


On Mon, 2016-05-23 at 21:26 -0500, Guillaume Poirier-Morency wrote:
It's possible to declare these types if you need to use them.

https://wiki.gnome.org/Projects/Vala/Manual/Attributes#FloatingType_A
tt
ribute

    [CCode (has_type_id = false)]
    [FloatingType (decimal = false, rank = 12, width = 128]
    struct float128_t {}





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]