lf-lang / reactor-c

A reactor runtime written in C
Other
11 stars 24 forks source link

Avoid naming conflict of header files. #111

Open erlingrj opened 2 years ago

erlingrj commented 2 years ago

Some of the header files have very common names like "platform.h" and "port.h". This is already causing problems when porting it to XMOS. Likely this will cause problems when integrating reactor-c with other libraries and projects. There seems to be two ways to solve this.

  1. Renaming: platform -> lf_platform, port -> lf_port etc.

  2. Use paths (thanks Christian :)) We can move all the header files out of the "core" folder and into the "include" folder. We put them like this:

core include -- reactor-c ---- platform.h ---- port.h ---- platform ------ lf_arduino.h

Then we put ~/include on the include path. This means that you have to do #include "reactor-c/platform.h" for all includes. I.e. you have to prepend reactor-c to all your includes. I think this latter solution is cleanest. We can at the same remove the symlink from include/core to core.

lhstrh commented 1 year ago

Based on conversation on Zulip, it appears that everyone so far is in favor of option 2.

erlingrj commented 1 year ago

OK. I will make a PR for this soon.

gundralaa commented 1 year ago

https://github.com/lf-lang/reactor-c/pull/147 Changed for lf_types for nrf port