Rename private __FUNCTION__ macro#47
Merged
Thecarisma merged 3 commits intoexoticlibraries:mainfrom Mar 10, 2021
MarcelInTO:main
Merged
Rename private __FUNCTION__ macro#47Thecarisma merged 3 commits intoexoticlibraries:mainfrom MarcelInTO:main
Thecarisma merged 3 commits intoexoticlibraries:mainfrom
MarcelInTO:main
Conversation
… warning on MSVC compilers - Use Microsoft's builtin __FUNCTION__ macro if it's available and __func__ is not
- Reduce warning spam when using MSVC compiler
… that cause problems if they are included before std headers that use the min and max keywords (eg <limits>). In general, including windows.h causes a lot of problems to cross platform code being compiled on windows and some projects go to great lengths to avoid it. I would love to see it gone entirely from the test framework.
|
Hello @MarcelInTO apologies for the late reply, I have been logged out by guthub and I don't have access to my 2fa device anymore. When you say "windows.h causes lot of problems to cross platform code" and "would love to see it gone entirely from the test framework" What do you intend to see go from the test framework, windows.h or the problems related to cross platform builds |
|
Good fix on the FUNCTION I also tried to avoid overriding the compiler defined macros, but that skip my mind. I ll be sure to merge this as soon as I can. |
Contributor
Author
|
Hello,
First of all, I was looking around for a simple to use, preferably header
only, test framework for a library I just started working on, because
google test is a pain to set up and maintain and I wanted something much
more lightweight. I came across yours and gave it a try. Its only been a
couple of days, but so far it is just what I needed. So, thanks!
Seeing the "#include <windows.h>" removed is what I meant. The biggest
issues that I personally have had with including "windows.h" is when you
get to socket and network communications code that is trying to be cross
platform. Even libraries like boost asio give problems if you include
windows.h along with them, or in the wrong order. So, for the project I am
using the test framework for now (which is purely a 3D math library), it
is not a problem. The only thing I ran into is the min/max issue. However,
if I was to use the framework on some of my other projects, especially the
ones that do network communication, I think it would be more of a headache.
While I have your attention, I do have a question.
I haven't studied the documentation closely yet, but I was trying to do
something that failed miserably and I'd like to ask directly if its
possible:
The library I am using the test framework is all header only templates so
that the user can use it with float, double (or long double eventually). It
would be great to templatize some of the test cases so that I don't have to
duplicate them for each of the supported types. Is that possible?
Best regards,
Marcel
…On Wed, Mar 10, 2021 at 10:53 AM Youngmaster27 ***@***.***> wrote:
Hello @MarcelInTO <https://github.com/MarcelInTO> apologies for the late
reply, I have been logged out by guthub and I don't have access to my 2fa
device anymore.
When you say "windows.h causes lot of problems to cross platform code" and
"would love to see it gone entirely from the test framework"
What do you intend to see go from the test framework, windows.h or the
problems related to cross platform builds
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#47 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABJT45VVJCB7TZRWS77HTKLTC6523ANCNFSM4Y4YNZZA>
.
|
Member
|
Actually, the ONLY thing windows.h is used for is printing the result with
color in the terminal,
so removing it won't cause any issue I'll provide a macro to prevent the
inclusion of the windows.h
header in the next release before the weekends.
For the use case that failed miserably can you open an issue for it with
detail and if possible with some code snippet.
It currently not possible to templatize a test case, that sounds like a
good feature, open an issue on what to expect from the template feature.
I'll sure to prioritize the two issues after the upcoming release.
… |
Member
|
Hello MarcelInTO,
I just made a new release, which includes the option to compile without the
windows.h header file. By simply defining the macro
CESTER_EXCLUDE_WINDOWS_H before
including cester.h all features depending on windows.h will use
an alternative. See this page
https://exoticlibraries.github.io/libcester/docs/selective_compilation.html#do-not-include-windows-h
for more detail on how to exclude windows.h
…On Wed, Mar 10, 2021 at 8:28 PM Azeez Adewale ***@***.***> wrote:
Actually, the ONLY thing windows.h is used for is printing the result with
color in the terminal,
so removing it won't cause any issue I'll provide a macro to prevent the
inclusion of the windows.h
header in the next release before the weekends.
For the use case that failed miserably can you open an issue for it with
detail and if possible with some code snippet.
It currently not possible to templatize a test case, that sounds like a
good feature, open an issue on what to expect from the template feature.
I'll sure to prioritize the two issues after the upcoming release.
>
|
Member
|
See this test for how to exclude windows.h
https://github.com/exoticlibraries/libcester/blob/main/test/test_no_windows_h.c
On Fri, Mar 12, 2021 at 9:18 PM Azeez Adewale ***@***.***>
wrote:
… Hello MarcelInTO,
I just made a new release, which includes the option to compile without
the windows.h header file. By simply defining the macro
CESTER_EXCLUDE_WINDOWS_H before including cester.h all features depending
on windows.h will use an alternative. See this page
https://exoticlibraries.github.io/libcester/docs/selective_compilation.html#do-not-include-windows-h
for more detail on how to exclude windows.h
On Wed, Mar 10, 2021 at 8:28 PM Azeez Adewale ***@***.***>
wrote:
> Actually, the ONLY thing windows.h is used for is printing the result
> with color in the terminal,
> so removing it won't cause any issue I'll provide a macro to prevent the
> inclusion of the windows.h
> header in the next release before the weekends.
>
> For the use case that failed miserably can you open an issue for it with
> detail and if possible with some code snippet.
> It currently not possible to templatize a test case, that sounds like a
> good feature, open an issue on what to expect from the template feature.
> I'll sure to prioritize the two issues after the upcoming release.
>
>>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rename private FUNCTION macro to CESTER_FUNCTION to prevent…warning on MSVC compilers
Use Microsoft's built-in FUNCTION macro if it's available and func is not