- Rename @extern to @cname, deprecating the old name #2493.

This commit is contained in:
Christoffer Lerno
2025-10-25 15:55:25 +02:00
parent 423152202f
commit 8aaf54e8b1
76 changed files with 393 additions and 369 deletions

View File

@@ -23,14 +23,14 @@ enum Primitive : int (int value)
POLYGON = 9,
}
extern fn void clear(BitField mask) @extern("glClear") @public;
extern fn void clear(BitField mask) @cname("glClear") @public;
extern fn void begin(BitField mask) @extern("glBegin") @public;
extern fn void begin(BitField mask) @cname("glBegin") @public;
extern fn void end() @extern("glEnd") @public;
extern fn void end() @cname("glEnd") @public;
extern fn void flush() @extern("glFlush") @public;
extern fn void flush() @cname("glFlush") @public;
extern fn void color3f(float r, float g, float b) @extern("glColor3f") @public;
extern fn void color3f(float r, float g, float b) @cname("glColor3f") @public;
extern fn void vertex3f(float x, float y, float z) @extern("glVertex3f") @public;
extern fn void vertex3f(float x, float y, float z) @cname("glVertex3f") @public;

View File

@@ -31,21 +31,21 @@ fn void Window.makeContextCurrent(self) @public
return _glfwMakeContextCurrent((_Window*)self);
}
extern fn void initialize() @extern("glfwInit") @public;
extern fn void initialize() @cname("glfwInit") @public;
extern fn void terminate() @extern("glfwTerminate") @public;
extern fn void terminate() @cname("glfwTerminate") @public;
extern fn void pollEvents() @extern("glfwPollEvents") @public;
extern fn void pollEvents() @cname("glfwPollEvents") @public;
typedef _Window @private = void;
typedef _Monitor @private = void;
extern fn _Window* _glfwCreateWindow(int width, int height, char* title, _Monitor* monitor, _Window* share) @extern("glfwCreateWindow") @private;
extern fn _Window* _glfwCreateWindow(int width, int height, char* title, _Monitor* monitor, _Window* share) @cname("glfwCreateWindow") @private;
extern fn bool _glfwWindowShouldClose(_Window* window) @extern("glfwWindowShouldClose") @private;
extern fn bool _glfwWindowShouldClose(_Window* window) @cname("glfwWindowShouldClose") @private;
extern fn void _glfwDestroyWindow(_Window* window) @extern("glfwDestroyWindow") @private;
extern fn void _glfwDestroyWindow(_Window* window) @cname("glfwDestroyWindow") @private;
extern fn void _glfwSwapBuffers(_Window* window) @extern("glfwSwapBuffers") @private;
extern fn void _glfwSwapBuffers(_Window* window) @cname("glfwSwapBuffers") @private;
extern fn void _glfwMakeContextCurrent(_Window* window) @extern("glfwMakeContextCurrent") @private;
extern fn void _glfwMakeContextCurrent(_Window* window) @cname("glfwMakeContextCurrent") @private;

View File

@@ -48,11 +48,11 @@ const SYSTEM_HIDE_GAMEPAD_OVERLAY = 2;
// └───────────────────────────────────────────────────────────────────────────┘
/* Copies pixels to the framebuffer. */
extern fn void blit(char* data, int x, int y, uint width, uint height, uint flags) @extern("blit");
extern fn void blit(char* data, int x, int y, uint width, uint height, uint flags) @cname("blit");
/* Copies a subregion within a larger sprite atlas to the framebuffer. */
extern fn void blit_sub(char* data, int x, int y, uint width, uint height,
uint src_x, uint src_y, uint stride, uint flags) @extern("blitSub");
uint src_x, uint src_y, uint stride, uint flags) @cname("blitSub");
const BLIT_2BPP = 1;
const BLIT_1BPP = 0;
@@ -76,7 +76,7 @@ extern fn void oval(int x, int y, uint width, uint height);
extern fn void rect(int x, int y, uint width, uint height);
/* Draws text using the built-in system font. */
extern fn void text(char* text, int x, int y) @extern("text");
extern fn void text(char* text, int x, int y) @cname("text");
// ┌───────────────────────────────────────────────────────────────────────────┐
// │ │
@@ -127,10 +127,10 @@ char[8] smiley = {
0b11000011,
};
fn void start() @extern("start")
fn void start() @cname("start")
{}
fn void update() @extern("update")
fn void update() @cname("update")
{
DRAW_COLORS[0] = 2;
text("Hello from C3", 10, 10);