Re: [Vala] GLX (OpenGL Extension to the X Window System) binding!!



* Jürg Billeter wrote, On 15/08/08 15:24:
On Fri, 2008-08-15 at 15:17 +0100, Sam Liddicott wrote:
  
I have the same problem:

[CCode (cheader_file = "ntstatus.h", cprefix="NT_STATUS_")]
namespace NT_STATUS {
  [CCode (cname="NT_STATUS_OK")]
    public static NTSTATUS OK;
  [CCode (cname="NT_STATUS_NO_MEMORY")]
    public static NTSTATUS NO_MEMORY;
  [CCode (cname="NT_STATUS_INVALID_PARAMETER")]
    public static NTSTATUS INVALID_PARAMETER;
  [CCode (cname="NT_STATUS_UNSUCCESSFUL")]
    public static NTSTATUS UNSUCCESSFUL;

    [SimpleType][Compact]
    [CCode (cname="NTSTATUS", cprefix="NTSTATUS_",
default_value="NT_STATUS_OK")]
    public struct NTSTATUS {
        [CCode (cname="NT_STATUS_IS_OK")]
        protected bool IS_OK();
    }
}


I have to specify a cname for each NTSTATUS value, or it gets a dumb
prefix and comes out as:
  nt__status_INVALID_PARAMETER
instead of
  NT_STATUS_INVALID_PARAMETER
    

These values should be bound as constants, not as static variables,
e.g., public const NTSTATUS OK; Vala should use upper case letters by
default, then.
  
If I do:

[CCode (cheader_file = "ntstatus.h")]
namespace NT_STATUS {
    public const NTSTATUS OK;
    public const NTSTATUS NO_MEMORY;
    public const NTSTATUS INVALID_PARAMETER;
    public const NTSTATUS UNSUCCESSFUL;

then I get an extra underscore:

NT__STATUS_INVALID_PARAMETER

Sam


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