Browse Source

Fix typo in `package utf8`; add `wchar_t` to `package c`

gingerBill 5 years ago
parent
commit
0977ac111a
2 changed files with 3 additions and 1 deletions
  1. 2 0
      core/c/c.odin
  2. 1 1
      core/unicode/utf8/utf8.odin

+ 2 - 0
core/c/c.odin

@@ -31,3 +31,5 @@ ssize_t   :: b.int;
 ptrdiff_t :: b.int;
 ptrdiff_t :: b.int;
 uintptr_t :: b.uintptr;
 uintptr_t :: b.uintptr;
 intptr_t  :: b.int;
 intptr_t  :: b.int;
+
+wchar_t :: (ODIN_OS == "windows") ? b.u16 : b.u32;

+ 1 - 1
core/unicode/utf8/utf8.odin

@@ -167,7 +167,7 @@ rune_at_pos :: proc(s: string, pos: int) -> rune {
 	}
 	}
 
 
 	i := 0;
 	i := 0;
-	for c in s {
+	for r in s {
 		if i == pos {
 		if i == pos {
 			return r;
 			return r;
 		}
 		}