plum-umd / the-838e-compiler

Compiler for CMSC 838E
2 stars 0 forks source link

ccall #66

Open 8tx7K38ej1aBTKWK opened 3 years ago

8tx7K38ej1aBTKWK commented 3 years ago

This PR implements the second part of #43, which adds a ccall function to villian. The detail of ccall is described here: https://github.com/plum-umd/the-838e-compiler/issues/43#issuecomment-793462290.

I also added a wrapper for libunistring function and moved all char related functions as a library in lib/char.rkt. In this way, we don't need to link libunistring statically anymore. It also provides an example for the C API: unistring.c

The only problem now is the unit test. Because ccall is not a racket function, we need to let raco test ignore some of the files, but I'm not sure how to fix this problem.

I'm pretty sure the ccall function work as intended. As an experiement, I added a super simplified wrapper for SDL on sdl branch: