Skip to content

Commit 2b6a606

Browse files
committed
fixed: some build issues and weird compiler hangups
1 parent f8e6194 commit 2b6a606

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

compiler/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ FLAGS=""
7474
if [ ! -z ${ONYX_TARGET+x} ]; then
7575
FLAGS="$FLAGS --target=$ONYX_TARGET"
7676
fi
77-
$ONYX_CC -shared $FLAGS -o "libonyx.$suffix" *.o $LIBS $LIBRARY_BUILD_ARGS
77+
$ONYX_CC -shared -fPIC $FLAGS -o "libonyx.$suffix" *.o $LIBS $LIBRARY_BUILD_ARGS
7878

7979
echo "Compiling onyx executable"
8080
$ONYX_CC $INCLUDES $FLAGS cli/main.c *.o -o onyx $LIBS

core/container/array.onyx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,12 @@ Array.filter :: macro (arr: &[..] $T, body: Code) {
308308
#overload #order 100
309309
__for_expansion :: macro (_s: &[..] $T, $flags: __For_Expansion_Flags, $body: Code)
310310
{
311+
remove_element :: macro () {
312+
Array.delete(__s, __i)
313+
__i -= 1
314+
__count -= 1
315+
}
316+
311317
__s := _s
312318
__data := __s.data
313319
__count := __s.count
@@ -322,13 +328,7 @@ __for_expansion :: macro (_s: &[..] $T, $flags: __For_Expansion_Flags, $body: Co
322328
v := __data[__i]
323329
}
324330

325-
#unquote body(v, __i) #skip_scope(1) #inject {
326-
remove_element :: macro () {
327-
Array.delete(__s, __i)
328-
__i -= 1
329-
__count -= 1
330-
}
331-
}
331+
#unquote body(v, __i) #skip_scope(1)
332332
}
333333
}
334334

core/container/optional.onyx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ use core
1717
/// Pass a type as the first argument to force the type, otherwise
1818
/// the type will be inferred from the parameter type.
1919
Optional.make :: #match #locked {
20-
((x: $T) => (?T).{ Some = x }),
21-
($T: type_expr, x: T) => ((?T).{ Some = x })
20+
(x: $T) -> ? T { return x },
21+
($T: type_expr, x: T) -> ? T { return x }
2222
}
2323

2424
/// Create an empty Optional of a certain type. This procedure

0 commit comments

Comments
 (0)