-
Notifications
You must be signed in to change notification settings - Fork 98
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
Do not add feature test macros #7
Conversation
Patch submitted upstream mity/acutest#7
Hi @zeehio , to be honest, I was thinking quite a lot before I merged the referred #5, because I disliked how the The current PR makes this even worse in my eyes: It makes quite a hybrid animal from I would therefore highly prefer if we could unify on strictly following the environment and never setting such macro manually in the header, if that's possible. Furthermore, as it is implemented, it also seems to change the default run-time behavior in other ways. In particular, not using So my counter-proposal is as follows (and please let me know if it would satisfy your needs):
Would this work for you? |
…option is used" This reverts commit 6700b9d.
d4c21e8
to
917e56e
Compare
Your proposal is much better than mine. I have updated the PR with your instructions, so you don't have to type more if you don't want to. I have given you too much work already. 😅 But feel free to do the commit yourself if you prefer. By the way, I also disabled the Thanks for your careful thoughts and detailed explanation. |
include/cutest.h
Outdated
#elif defined CUTEST_WIN__ | ||
test_colorize__ = _isatty(_fileno(stdout)); | ||
test_colorize__ = _isatty(STDOUT_FILENO); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For Windows, _isatty(_fileno(stdout))
should be kept. Windows SDK does not have <unistd.h>
Also define test_error__ only if is used.
917e56e
to
ee38d5b
Compare
Thanks for the review. Done. |
Thanks, @zeehio |
On b4c1548 (see #5) I proposed defining
_POSIX_C_SOURCE
insidecutest.h
in order to enable the macros to use POSIX under unix-like systems, as POSIX was used by cutest on those systems.Here I propose to follow whatever the user wants. This means:
If the user explicitly defines a strict standard C compliance (e.g. compiling using
--std=c99
) then we do not use any POSIX feature. This is detected through the definition of the STRICT_ANSI macro.If the user does not enforce any C standard, we assume POSIX is available if the system is unix-like, as before.
I believe this approach is better than the previous one because if any cutest user does not want to rely on POSIX features we won't enable them and we won't use them. However by default we use them if they are available.