Skip to content

Commit

Permalink
More fixups
Browse files Browse the repository at this point in the history
  • Loading branch information
kartik-s committed Sep 24, 2024
1 parent a061b3e commit 6172833
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ jobs:
CL_SOURCE_REGISTRY: "${{ github.workspace }}//"
run: |
$SBCL_SRC/run-sbcl.sh --load script.lisp --quit
gcc -Wall -fPIC -shared -o libcalc.so libcalc.c -lsbcl
gcc -Wall -o example example.c -lcalc -lsbcl
gcc -Wall -fPIC -shared -o libcalc.so libcalc.c -lsbcl -I../../lib
gcc -Wall -o example example.c -lcalc -lsbcl -I../../lib
sudo mv libcalc.so /usr/local/lib
sudo cp libcalc.core /usr/local/lib
echo "(+ 1 2)" | ./example | tr -d '\n' | grep "> 3> "
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ jobs:
CL_SOURCE_REGISTRY: "${{ github.workspace }}//"
run: |
$SBCL_SRC/run-sbcl.sh --load script.lisp --quit
gcc -Wall -fPIC -shared -o libcalc.dylib libcalc.c -lsbcl
gcc -Wall -o example example.c -lcalc -lsbcl
gcc -Wall -fPIC -shared -o libcalc.dylib libcalc.c -lsbcl -I../../lib
gcc -Wall -o example example.c -lcalc -lsbcl -I../../lib
echo "(+ 1 2)" | ./example | tr -d '\n' | grep "> 3> "
echo "(+ 1 2)" | python3 ./example.py | tr -d '\n' | grep "> 3> "
python3 ./exhaust_heap.py | grep "returned to Python with error code 2 after heap exhaustion"
4 changes: 2 additions & 2 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ jobs:
MSYS2_PATH_TYPE: inherit
run: |
$SBCL_SRC/run-sbcl.sh --load script.lisp --quit
${{ matrix.cc }} -Wall -fPIC -shared -Wl,--export-all-symbols -o libcalc.dll libcalc.c -Wl,--whole-archive $SBCL_SRC/src/runtime/libsbcl.a -Wl,--no-whole-archive -ladvapi32 -lsynchronization -lws2_32 -lzstd
${{ matrix.cc }} -Wall -o example example.c -lcalc -L.
${{ matrix.cc }} -Wall -fPIC -shared -Wl,--export-all-symbols -o libcalc.dll libcalc.c -Wl,--whole-archive $SBCL_SRC/src/runtime/libsbcl.a -Wl,--no-whole-archive -ladvapi32 -lsynchronization -lws2_32 -lzstd -I../../lib
${{ matrix.cc }} -Wall -o example example.c -lcalc -L. -I../../lib
mv libcalc.dll $MSYSTEM_PREFIX/bin
cp libcalc.core $MSYSTEM_PREFIX/bin
echo "(+ 1 2)" | ./example.exe | tr -d '\r\n' | grep "> 3> "
Expand Down
4 changes: 2 additions & 2 deletions examples/libcalc/example.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ int main(int argc, char **argv) {

while (fgets(source, sizeof(source), stdin) != NULL) {
expr_type expr;
if (calc_parse(source, &expr) != ERR_SUCCESS)
if (calc_parse(source, &expr) != LISP_ERR_SUCCESS)
die("unable to parse expression");

char *result;
Expand All @@ -28,7 +28,7 @@ int main(int argc, char **argv) {
else
calc_simplify(expr, &simplified_expr);

if (calc_expression_to_string(simplified_expr, &result) != ERR_SUCCESS)
if (calc_expression_to_string(simplified_expr, &result) != LISP_ERR_SUCCESS)
die("unable to print expression to string");

printf("\n%s\n> ", result);
Expand Down

0 comments on commit 6172833

Please sign in to comment.