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

Check for Visual Studio 2010 - without stdbool.h #125

Closed
bel2125 opened this issue Aug 25, 2017 · 7 comments
Closed

Check for Visual Studio 2010 - without stdbool.h #125

bel2125 opened this issue Aug 25, 2017 · 7 comments

Comments

@bel2125
Copy link
Contributor

bel2125 commented Aug 25, 2017

Currently check does not work for Visual Studio 2010 project, because it misses the stdbool.h header from the C99 standard. This include was introduced about a year ago in 6c19a8e

Could we just replace this bool by an int, so older but still common Visual Studio compilers (2010 and even 2012) could use also recent versions of check?

I could prepare a PR if you like.

bel2125 added a commit to civetweb/check that referenced this issue Aug 25, 2017
While this header is standard in C99, it does not exist in C89/C90.
Microsoft Visual Studio added this header only in version 2013.
Still common common compilers Visual Studio 2010 and 2012 (and all earlier)
do not support it.

Here we do not really have a benefit as compared to just using 'int'
instead of 'bool', so this dependency can easily be avoided to support
Visual Studio 2010 (see also libcheck#125).
@brarcher
Copy link
Contributor

Hm, sorry that the change broke you on VS 2010. My expectation with using AppVeyor would be to catch issues like this; maybe the version of VS there is different than 2010.

The function is internal, so there is no problem if the signature is changed. Alternatively, a compile time check could be made for stdbool.h and if it does not exist provide a #define for true and false in libcompat.h if it does not exist. That would have the benefit of prevent this breakage in the future if someone introduces usage of true/false but is unaware of the unavailability of stdbool.h in VC 2010.

Either way, I would be glad to accept a pull request with changes.

@brarcher
Copy link
Contributor

I see in your project you also added an AppVeyor builds for VC 2010. If you would like to add a build for that in Check's AppVeyor configuration as well, feel free.

@bel2125
Copy link
Contributor Author

bel2125 commented Aug 28, 2017

I removed the stdbool dependency (civetweb@9c59455) and added an AppVeyor configuration (civetweb@5eed08f).

But it turns out, the unit tests of check have several non C89 compliant functions, mainly because variables are not declared "on top" (civetweb@5c7b771), regex are missing (civetweb@2447c87), INFINITY and NAN are not defined (civetweb@2b406f1), and isnan/isinf/isfinite is also missing (civetweb@af96d7f). Probably some things could be done in a different way in particular with the infinity / NaN support.

It seems I cannot do a direct unit test of check on AppVeyor (AppVeyor interface does not allow me to add this project), but the indirect test through the CivetWeb build seems to work.

@bel2125
Copy link
Contributor Author

bel2125 commented Aug 28, 2017

The unit tests are working now for Visual Studio 2010 and 2012.

Please have a look at the PR #129

I encountered some open topics regarding INFINITY / NAN, where you have to decide how you want to have this solved.

I also tried to get Visual Studio 2005, 2008 and 2017 running, but they are no longer / not yet installed in the AppVeyor build image. Maybe it would be the best to remove these three builds from the appveyor file again, and deal with it in a separate PR, if required.

@brarcher
Copy link
Contributor

It seems I cannot do a direct unit test of check on AppVeyor

Is it that I need to add something on Check's AppVeyor interface? If so, what needs to be added?

@bel2125
Copy link
Contributor Author

bel2125 commented Aug 29, 2017

It seems I cannot do a direct unit test of check on AppVeyor

Is it that I need to add something on Check's AppVeyor interface? If so, what needs to be added?

I'm not sure if you can config that all forks are also built with AppVeyor.

It's probably somewhat my fault, that I forked check as civetweb/check ("the version of check required for civetweb") instead of bel2125/check ("the version modified by me"), so it is connected with the civetweb organisation github account, while my AppVeyor account is connected to the bel2125 github account. There is an internal link in github making bel2125/civetweb the same as civetweb/civetweb, but there is no such link for check ... I'm not really sure and I don't know if I can solve this without the help of the AppVeyor and/or github support team.
For the moment, I don't you can't do anything.

@bel2125
Copy link
Contributor Author

bel2125 commented Sep 1, 2017

Solved with PR #129

In case someone needs Visual Studio 2008 support, the appveyor.yml file is prepared, the build works, but it seems some unit tests fail for VS2008. Fixing the code VS2008 is out of scope for this issue.

Visual Studio 2010, 2012, 2013, 2015 and 2017 build are working now.

@bel2125 bel2125 closed this as completed Sep 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants