Skip to content

Instantly share code, notes, and snippets.

@flyx
Created February 5, 2012 11:09
Show Gist options
  • Save flyx/1744787 to your computer and use it in GitHub Desktop.
Save flyx/1744787 to your computer and use it in GitHub Desktop.
Example interfacing with C and arrays in Ada
with Interfaces.C;
package Whatev is
package C renames Interfaces.C;
type Vector_Index is (X, Y, Z, W);
type Vector is array (Vector_Index range <>) of aliased C.double;
pragma Convention (C, Vector);
procedure Vertex (Value : Vector);
pragma Import (Convention => StdCall, Entity => Vertex,
External_Name => "glVertex4dv");
end Whatev;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment