Browse Source

Have default `foreign import` system paths

gingerBill 1 year ago
parent
commit
d9fafa7000

+ 2 - 0
vendor/commonmark/cmark.odin

@@ -25,6 +25,8 @@ when ODIN_OS == .Windows {
 	foreign import lib "system:cmark"
 	foreign import lib "system:cmark"
 } else when ODIN_OS == .Darwin {
 } else when ODIN_OS == .Darwin {
 	foreign import lib "system:cmark"
 	foreign import lib "system:cmark"
+} else {
+	foreign import lib "system:cmark"
 }
 }
 
 
 Option :: enum c.int {
 Option :: enum c.int {

+ 4 - 3
vendor/stb/image/stb_image.odin

@@ -4,9 +4,10 @@ import c "core:c/libc"
 
 
 #assert(size_of(c.int) == size_of(b32))
 #assert(size_of(c.int) == size_of(b32))
 
 
-when ODIN_OS == .Windows { foreign import stbi "../lib/stb_image.lib" }
-when ODIN_OS == .Linux   { foreign import stbi "../lib/stb_image.a"   }
-when ODIN_OS == .Darwin  { foreign import stbi "../lib/darwin/stb_image.a"   }
+     when ODIN_OS == .Windows { foreign import stbi "../lib/stb_image.lib"      }
+else when ODIN_OS == .Linux   { foreign import stbi "../lib/stb_image.a"        }
+else when ODIN_OS == .Darwin  { foreign import stbi "../lib/darwin/stb_image.a" }
+else                          { foreign import stbi "system:stb_image"          }
 
 
 #assert(size_of(b32) == size_of(c.int))
 #assert(size_of(b32) == size_of(c.int))
 
 

+ 5 - 3
vendor/stb/image/stb_image_resize.odin

@@ -2,9 +2,11 @@ package stb_image
 
 
 import c "core:c/libc"
 import c "core:c/libc"
 
 
-when ODIN_OS == .Windows { foreign import lib "../lib/stb_image_resize.lib" }
-when ODIN_OS == .Linux   { foreign import lib "../lib/stb_image_resize.a"   }
-when ODIN_OS == .Darwin  { foreign import lib "../lib/darwin/stb_image_resize.a"   }
+     when ODIN_OS == .Windows { foreign import lib "../lib/stb_image_resize.lib"      }
+else when ODIN_OS == .Linux   { foreign import lib "../lib/stb_image_resize.a"        }
+else when ODIN_OS == .Darwin  { foreign import lib "../lib/darwin/stb_image_resize.a" }
+else                          { foreign import stbi "system:stb_image_resize"         }
+
 
 
 //////////////////////////////////////////////////////////////////////////////
 //////////////////////////////////////////////////////////////////////////////
 //
 //

+ 4 - 3
vendor/stb/image/stb_image_write.odin

@@ -2,9 +2,10 @@ package stb_image
 
 
 import c "core:c/libc"
 import c "core:c/libc"
 
 
-when ODIN_OS == .Windows { foreign import stbiw "../lib/stb_image_write.lib" }
-when ODIN_OS == .Linux   { foreign import stbiw "../lib/stb_image_write.a"   }
-when ODIN_OS == .Darwin  { foreign import stbiw "../lib/darwin/stb_image_write.a"   }
+     when ODIN_OS == .Windows { foreign import stbiw "../lib/stb_image_write.lib"      }
+else when ODIN_OS == .Linux   { foreign import stbiw "../lib/stb_image_write.a"        }
+else when ODIN_OS == .Darwin  { foreign import stbiw "../lib/darwin/stb_image_write.a" }
+else                          { foreign import stbi "system:stb_image_write"           }
 
 
 
 
 write_func :: proc "c" (ctx: rawptr, data: rawptr, size: c.int)
 write_func :: proc "c" (ctx: rawptr, data: rawptr, size: c.int)

+ 4 - 3
vendor/stb/rect_pack/stb_rect_pack.odin

@@ -4,9 +4,10 @@ import c "core:c/libc"
 
 
 #assert(size_of(b32) == size_of(c.int))
 #assert(size_of(b32) == size_of(c.int))
 
 
-when ODIN_OS == .Windows { foreign import lib "../lib/stb_rect_pack.lib" }
-when ODIN_OS == .Linux   { foreign import lib "../lib/stb_rect_pack.a"   }
-when ODIN_OS == .Darwin  { foreign import lib "../lib/darwin/stb_rect_pack.a"   }
+     when ODIN_OS == .Windows { foreign import lib "../lib/stb_rect_pack.lib"      }
+else when ODIN_OS == .Linux   { foreign import lib "../lib/stb_rect_pack.a"        }
+else when ODIN_OS == .Darwin  { foreign import lib "../lib/darwin/stb_rect_pack.a" }
+else                          { foreign import lib "system:stb_rect_pack"          }
 
 
 Coord :: distinct c.int
 Coord :: distinct c.int
 _MAXVAL :: max(Coord)
 _MAXVAL :: max(Coord)

+ 4 - 3
vendor/stb/truetype/stb_truetype.odin

@@ -3,9 +3,10 @@ package stb_truetype
 import c "core:c"
 import c "core:c"
 import stbrp "vendor:stb/rect_pack"
 import stbrp "vendor:stb/rect_pack"
 
 
-when ODIN_OS == .Windows { foreign import stbtt "../lib/stb_truetype.lib" }
-when ODIN_OS == .Linux   { foreign import stbtt "../lib/stb_truetype.a"   }
-when ODIN_OS == .Darwin  { foreign import stbtt "../lib/darwin/stb_truetype.a"   }
+     when ODIN_OS == .Windows { foreign import stbtt "../lib/stb_truetype.lib"      }
+else when ODIN_OS == .Linux   { foreign import stbtt "../lib/stb_truetype.a"        }
+else when ODIN_OS == .Darwin  { foreign import stbtt "../lib/darwin/stb_truetype.a" }
+else                          { foreign import stbtt "system:stb_truetype"          }
 
 
 
 
 ///////////////////////////////////////////////////////////////////////////////
 ///////////////////////////////////////////////////////////////////////////////

+ 4 - 3
vendor/stb/vorbis/stb_vorbis.odin

@@ -3,9 +3,10 @@ package stb_vorbis
 import c "core:c/libc"
 import c "core:c/libc"
 
 
 
 
-when ODIN_OS == .Windows { foreign import lib "../lib/stb_vorbis.lib" }
-when ODIN_OS == .Linux   { foreign import lib "../lib/stb_vorbis.a"   }
-when ODIN_OS == .Darwin  { foreign import lib "../lib/darwin/stb_vorbis.a"   }
+     when ODIN_OS == .Windows { foreign import lib "../lib/stb_vorbis.lib"      }
+else when ODIN_OS == .Linux   { foreign import lib "../lib/stb_vorbis.a"        }
+else when ODIN_OS == .Darwin  { foreign import lib "../lib/darwin/stb_vorbis.a" }
+else                          { foreign import lib "system:stb_vorbis"          }