diff --git a/code/demo.odin b/code/demo.odin index 88aa651c0..c673b54fb 100644 --- a/code/demo.odin +++ b/code/demo.odin @@ -10,10 +10,6 @@ #import "utf8.odin"; main :: proc() { - fmt.println("GOOGOLPLEX"); -} - -/* foo :: proc(x: ^i32) -> (int, int) { fmt.println("^int"); return 123, cast(int)(x^); @@ -56,4 +52,3 @@ main :: proc() { f = foo; f(); } -*/ diff --git a/core/opengl.odin b/core/opengl.odin index 760658baf..44ebc26c5 100644 --- a/core/opengl.odin +++ b/core/opengl.odin @@ -1,32 +1,32 @@ -#foreign_system_library "opengl32.lib" when ODIN_OS == "windows"; +#foreign_system_library lib "opengl32.lib" when ODIN_OS == "windows"; #import win32 "sys/windows.odin" when ODIN_OS == "windows"; #include "opengl_constants.odin"; -Clear :: proc(mask: u32) #foreign opengl32 "glClear"; -ClearColor :: proc(r, g, b, a: f32) #foreign opengl32 "glClearColor"; -Begin :: proc(mode: i32) #foreign opengl32 "glBegin"; -End :: proc() #foreign opengl32 "glEnd"; -Finish :: proc() #foreign opengl32 "glFinish"; -BlendFunc :: proc(sfactor, dfactor: i32) #foreign opengl32 "glBlendFunc"; -Enable :: proc(cap: i32) #foreign opengl32 "glEnable"; -Disable :: proc(cap: i32) #foreign opengl32 "glDisable"; -GenTextures :: proc(count: i32, result: ^u32) #foreign opengl32 "glGenTextures"; -DeleteTextures:: proc(count: i32, result: ^u32) #foreign opengl32 "glDeleteTextures"; -TexParameteri :: proc(target, pname, param: i32) #foreign opengl32 "glTexParameteri"; -TexParameterf :: proc(target: i32, pname: i32, param: f32) #foreign opengl32 "glTexParameterf"; -BindTexture :: proc(target: i32, texture: u32) #foreign opengl32 "glBindTexture"; -LoadIdentity :: proc() #foreign opengl32 "glLoadIdentity"; -Viewport :: proc(x, y, width, height: i32) #foreign opengl32 "glViewport"; -Ortho :: proc(left, right, bottom, top, near, far: f64) #foreign opengl32 "glOrtho"; -Color3f :: proc(r, g, b: f32) #foreign opengl32 "glColor3f"; -Vertex3f :: proc(x, y, z: f32) #foreign opengl32 "glVertex3f"; +Clear :: proc(mask: u32) #foreign lib "glClear"; +ClearColor :: proc(r, g, b, a: f32) #foreign lib "glClearColor"; +Begin :: proc(mode: i32) #foreign lib "glBegin"; +End :: proc() #foreign lib "glEnd"; +Finish :: proc() #foreign lib "glFinish"; +BlendFunc :: proc(sfactor, dfactor: i32) #foreign lib "glBlendFunc"; +Enable :: proc(cap: i32) #foreign lib "glEnable"; +Disable :: proc(cap: i32) #foreign lib "glDisable"; +GenTextures :: proc(count: i32, result: ^u32) #foreign lib "glGenTextures"; +DeleteTextures:: proc(count: i32, result: ^u32) #foreign lib "glDeleteTextures"; +TexParameteri :: proc(target, pname, param: i32) #foreign lib "glTexParameteri"; +TexParameterf :: proc(target: i32, pname: i32, param: f32) #foreign lib "glTexParameterf"; +BindTexture :: proc(target: i32, texture: u32) #foreign lib "glBindTexture"; +LoadIdentity :: proc() #foreign lib "glLoadIdentity"; +Viewport :: proc(x, y, width, height: i32) #foreign lib "glViewport"; +Ortho :: proc(left, right, bottom, top, near, far: f64) #foreign lib "glOrtho"; +Color3f :: proc(r, g, b: f32) #foreign lib "glColor3f"; +Vertex3f :: proc(x, y, z: f32) #foreign lib "glVertex3f"; TexImage2D :: proc(target, level, internal_format, width, height, border, - format, _type: i32, pixels: rawptr) #foreign opengl32 "glTexImage2D"; + format, _type: i32, pixels: rawptr) #foreign lib "glTexImage2D"; -GetError :: proc() -> i32 #foreign opengl32 "glGetError"; -GetString :: proc(name: i32) -> ^byte #foreign opengl32 "glGetString"; -GetIntegerv :: proc(name: i32, v: ^i32) #foreign opengl32 "glGetIntegerv"; +GetError :: proc() -> i32 #foreign lib "glGetError"; +GetString :: proc(name: i32) -> ^byte #foreign lib "glGetString"; +GetIntegerv :: proc(name: i32, v: ^i32) #foreign lib "glGetIntegerv"; string_data :: proc(s: string) -> ^u8 #inline { return ^s[0]; } diff --git a/core/sys/windows.odin b/core/sys/windows.odin index 85a53a712..45114d246 100644 --- a/core/sys/windows.odin +++ b/core/sys/windows.odin @@ -294,7 +294,7 @@ WriteBarrier :: proc() #foreign kernel32; ReadBarrier :: proc() #foreign kernel32; -// GDI + BITMAPINFOHEADER :: struct #ordered { size: u32, width, height: i32, @@ -405,10 +405,10 @@ WGL_CONTEXT_PROFILE_MASK_ARB :: 0x9126; WGL_CONTEXT_CORE_PROFILE_BIT_ARB :: 0x0001; WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB :: 0x0002; -wglCreateContext :: proc(hdc: HDC) -> HGLRC #foreign opengl32; +wglCreateContext :: proc(hdc: HDC) -> HGLRC #foreign opengl32; wglMakeCurrent :: proc(hdc: HDC, hglrc: HGLRC) -> BOOL #foreign opengl32; -wglGetProcAddress :: proc(c_str: ^u8) -> PROC #foreign opengl32; -wglDeleteContext :: proc(hglrc: HGLRC) -> BOOL #foreign opengl32; +wglGetProcAddress :: proc(c_str: ^u8) -> PROC #foreign opengl32; +wglDeleteContext :: proc(hglrc: HGLRC) -> BOOL #foreign opengl32; diff --git a/src/ir.c b/src/ir.c index 80c9949ea..29e81c899 100644 --- a/src/ir.c +++ b/src/ir.c @@ -5213,7 +5213,11 @@ void ir_add_foreign_library_path(irModule *m, Entity *e) { for_array(path_index, m->foreign_library_paths) { String path = m->foreign_library_paths.e[path_index]; +#if defined(GB_SYSTEM_WINDOWS) + if (str_eq_ignore_case(path, library_path)) { +#else if (str_eq(path, library_path)) { +#endif return; } }