aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorGinger Bill <bill@gingerbill.org>2016-09-03 12:41:03 +0100
committerGinger Bill <bill@gingerbill.org>2016-09-03 12:41:03 +0100
commit11205f968ad2bf4893fa75df3fc3331f960039d1 (patch)
tree9f6504a674e1fc59346b98df961c20c773db2227 /examples
parente1a6775661d1ef57b84effa9b4c567c030b87556 (diff)
Typesafe variadic procedures
Diffstat (limited to 'examples')
-rw-r--r--examples/demo.odin27
-rw-r--r--examples/win32.odin2
2 files changed, 21 insertions, 8 deletions
diff --git a/examples/demo.odin b/examples/demo.odin
index 79cd9643b..a780bef1d 100644
--- a/examples/demo.odin
+++ b/examples/demo.odin
@@ -3,17 +3,28 @@
#load "game.odin"
main :: proc() {
- print_int(min(1, 2)); nl()
- print_int(max(1, 2)); nl()
- print_int(abs(-1337)); nl()
- a, b, c := 1, 2, -1337
+ print_ints :: proc(args: ..int) {
+ for i := 0; i < len(args); i++ {
+ print_int(args[i])
+ nl()
+ }
+ }
+ // print_ints()
+ // print_ints(1)
+ print_ints(1, 2, 3, 4, 5)
+
+ // print_int(min(1, 2)); nl()
+ // print_int(max(1, 2)); nl()
+ // print_int(abs(-1337)); nl()
+
+ // a, b, c := 1, 2, -1337
- print_int(min(a, b)); nl()
- print_int(max(a, b)); nl()
- print_int(abs(c) as int); nl()
+ // print_int(min(a, b)); nl()
+ // print_int(max(a, b)); nl()
+ // print_int(abs(c) as int); nl()
- nl()
+ // nl()
/*
Vec3 :: type struct { x, y, z: f32 }
Entity :: type struct {
diff --git a/examples/win32.odin b/examples/win32.odin
index ec543565b..744754b34 100644
--- a/examples/win32.odin
+++ b/examples/win32.odin
@@ -110,6 +110,8 @@ GetQueryPerformanceFrequency :: proc() -> i64 {
return r
}
+GetCommandLineA :: proc() -> ^u8 #foreign
+
// File Stuff