Re: [Vala] How to generate "inline" C functions?



2011/11/7 Tal Hadad <tal_hd hotmail com>


Is there any CCode attribute to make the generated C function "inline"?
Or, is it possible to generate C macros instead of functions with vala?

For example:
class Test {
  inline public void func1() {
  }Vala tutorial sadly doesn't say a word about it, but it shell look
like:public inline void func1() {}This onw works currently in vala.>
[Macro]
  public void func2() {
  }
}

This is sound a great feature request.But I would like that the macro
could also not be function-like, butalso be able to define functon,
 varibles, ...(i.e. full featured CMacro).


Vala produces static functions when possible, and gcc inlines them when
possible. So this is feature is already there.

Another question is, is it possible to use bit-field in vala classes?
Like this:
class Test {
  private bool b1 : 1;
  private bool b2 : 1;
  private bool b3 : 1;
  private uint i1 : 4;
}


It's not possible. This is something that could be trivially implemented
using a CCode argument like [CCode (bitfield = 1)] or such, without adding
new syntax.
If you have a good use case, you can request the feature at
bugzilla.gnome.org .

-- 
www.debian.org - The Universal Operating System


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