Re: [Vala] Extended floating types






 
      From: Guillaume Poirier-Morency <guillaumepoiriermorency gmail com>
 Sent: Tuesday, 24 May 2016, 3:26
 Subject: Re: [Vala] Extended floating types
   
It's possible to declare these types if you need to use them.

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

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

Good idea! Probably better still:
[SimpleType]
[CCode (has_type_id = false)]
[FloatingType (decimal = false, rank = 12, width = 128]
public struct float128_t {}
I think the SimpleType tells Vala the usual struct syntax isn't needed.You may also need the cheader_filename 
in there as welll.
You could also play around with the name, e.g. use cname="float128_t"then call it:public struct float128 
{}but maybe that should wait to see if it becomes bound in GLib first.
As an example, this is how double is bound to 
gdouble:https://git.gnome.org/browse/vala/tree/vapi/glib-2.0.vapi#n805



   


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