Table of Contents

Class NativeAttribute

Namespace
GB
Assembly
GBSharp.Framework.dll

Maps a GB# member onto a C symbol in the target backend.

[AttributeUsage(AttributeTargets.Method|AttributeTargets.Property, AllowMultiple = false, Inherited = false)]
public sealed class NativeAttribute : Attribute
Inheritance
NativeAttribute
Inherited Members

Remarks

This is the single mechanism by which GB# code reaches the underlying platform. The framework in this assembly uses it, and so does user code that needs to call a GBDK function the framework does not wrap (thesis section 19).

A member marked NativeAttribute is never lowered. The compiler discards its body and emits a direct call to Symbol, so the declared signature must match the C function it names.

Constructors

NativeAttribute(string)

public NativeAttribute(string symbol)

Parameters

symbol string

Properties

Symbol

The C identifier to emit at the call site.

public string Symbol { get; }

Property Value

string