Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce <* *> doc comments and fix dylib loading dynamic libraries. #1555

Merged
merged 1 commit into from
Oct 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@ jobs:
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64
..\..\build\${{ matrix.build_type }}\c3c.exe --debug-log build hello_world_win32_lib

- name: Compile and run dynlib-test
run: |
cd resources/examples/dynlib-test
..\..\..\build\${{ matrix.build_type }}\c3c.exe dynamic-lib add.c3
..\..\..\build\${{ matrix.build_type }}\c3c.exe compile-run test.c3 -l ./add.lib

- name: Vendor-fetch
run: |
build\${{ matrix.build_type }}\c3c.exe vendor-fetch raylib5
Expand Down Expand Up @@ -311,6 +317,15 @@ jobs:
../build/c3c compile-run linux_stack.c3
../build/c3c compile-run examples/args.c3 -- foo -bar "baz baz"

- name: Compile and run dynlib-test
run: |
cd resources/examples/dynlib-test
../../../build/c3c dynamic-lib add.c3
mv add.so libadd.so
cc test.c -L. -ladd -Wl,-rpath=.
./a.out
../../../build/c3c compile-run test.c3 -L . -l add -z -Wl,-rpath=.

- name: Compile run unit tests
run: |
cd test
Expand Down Expand Up @@ -621,6 +636,12 @@ jobs:
../build/c3c compile-run -O5 examples/load_world.c3
../build/c3c compile-run examples/args.c3 -- foo -bar "baz baz"

- name: Compile and run dynlib-test
run: |
cd resources/examples/dynlib-test
../../../build/c3c dynamic-lib add.c3
../../../build/c3c compile-run test.c3 -l ./add.dylib

- name: Compile run unit tests
run: |
cd test
Expand Down
6 changes: 3 additions & 3 deletions lib/std/ascii.c3
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ fn bool char.is_blank(char c) => is_blank_m(c);
fn bool char.is_cntrl(char c) => is_cntrl_m(c);
fn char char.to_lower(char c) => (char)to_lower_m(c);
fn char char.to_upper(char c) => (char)to_upper_m(c);
/**
* @require c.is_xdigit()
**/
<*
@require c.is_xdigit()
*>
fn char char.from_hex(char c) => c.is_digit() ? c - '0' : 10 + (c | 0x20) - 'a';

fn bool uint.in_range(uint c, uint start, uint len) => in_range_m(c, start, len);
Expand Down
274 changes: 137 additions & 137 deletions lib/std/atomic.c3

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions lib/std/bits.c3
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
module std::bits;

/**
* @require types::is_intlike($typeof(i)) `The input must be an integer or integer vector`
**/
<*
@require types::is_intlike($typeof(i)) `The input must be an integer or integer vector`
*>
macro reverse(i) => $$bitreverse(i);

/**
* @require types::is_intlike($typeof(i)) `The input must be an integer or integer vector`
**/
<*
@require types::is_intlike($typeof(i)) `The input must be an integer or integer vector`
*>
macro bswap(i) @builtin => $$bswap(i);

macro uint[<*>].popcount(self) => $$popcount(self);
Expand Down
Loading
Loading