Introduce a NUT_CHECK_BOOL m4 scriptlet and a header with nut_bool_t type#2537
Merged
jimklimov merged 2 commits intonetworkupstools:masterfrom Jul 19, 2024
Merged
Introduce a NUT_CHECK_BOOL m4 scriptlet and a header with nut_bool_t type#2537jimklimov merged 2 commits intonetworkupstools:masterfrom
NUT_CHECK_BOOL m4 scriptlet and a header with nut_bool_t type#2537jimklimov merged 2 commits intonetworkupstools:masterfrom
Conversation
….h> and/or <float.h> [networkupstools#1176] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…test.c et al: introduce a NUT_CHECK_BOOL scriptlet and a header with nut_bool_t type [networkupstools#1176] Chose to use a unique type name to avoid conflicts with third-party headers which deliver a `bool_t` (currently commonly hacked into many NUT sources). Using lower-cased `true` and `false` values, hoping for maximum compatibility with C99 and newer language standards (if the compilers do implement them on whatever obscure platform NUT gets built on, and then our new `nut_bool_t` definition can be just an alias for what the language gives us). A test case was added to make sure it behaves as expected on different systems. Converting the sources from their custom type definitions and usages would be a separate step. Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
NUT_CHECK_BOOL scriptlet and a header with nut_bool_t typeNUT_CHECK_BOOL m4 scriptlet and a header with nut_bool_t type
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.
Addresses parts of issues #31 and #1176.
Chose to use a unique type name to avoid conflicts with third-party headers which deliver a
bool_t(currently commonly hacked into many NUT sources).Using lower-cased
trueandfalsevalues, hoping for maximum compatibility with C99 and newer language standards (if the compilers do implement them on whatever obscure platform NUT gets built on, and then our newnut_bool_tdefinition can be just an alias for what the language gives us).A test case was added to make sure it behaves as expected on different systems.
Converting the sources from their custom type definitions and usages would be a separate step, probably targeted at a next NUT release. This foundational change (and its unit test) are wanted early, to collect feedback from different platforms NUT is built and packaged on while not impacting production code.