lexborisov / Modest

Modest is a fast HTML renderer implemented as a pure C99 library with no outside dependencies.
GNU Lesser General Public License v2.1
732 stars 65 forks source link

Add posix port headers for ib build tool support #60

Open hooddanielc opened 5 years ago

hooddanielc commented 5 years ago

The problem

I love ib build tool. It help keeps my code sane and easy to integrate with other projects. When building one of the examples, I ran into a lot of errors with undefined references. The references were undefined because ib could not find the implementation of some functions. I believe this is because ib works by running the preprocessor on the target, then follows all headers files in the evaluated source code and repeats for all found implementations. The problem is the source code for modest is unable to be compiled this way. So I decided to change some things to allow ib to compile one of the examples. I hope this is ok :)

The solution

In order for the build tool to work on Modest source code, I need to at least add missing headers for posix port implementation and any other implementations lacking a include-able header. I definitely missed some in this pr, but I didn't want to continue in case this pr is not welcome. I hope these changes are ok.

What worked for me

The following build tool specific code was not added to this pr because I thought it would be redundant when a Makefile is already used. I do not care to add build tool specific code to the project unless the project decided to replace make with ib. I got ib working in a few steps after this code change.

Will any changes in this pr negatively impact other users of Modest?

No impact at all, assuming I did not make any mistakes. The implementation is unchanged left intact.