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

Fix #95, add local isnan, isfinite macros #96

Merged
merged 1 commit into from
Aug 17, 2023

Conversation

jphickey
Copy link
Contributor

Checklist (Please check before submitting)

Describe the contribution
In case the system-provided math.h header does not provide an implementation if isnan or isfinite, use a local workaround.

Fixes #95

Testing performed
Build on VxWorks 6.9

Expected behavior changes
Build is successful

System(s) tested on
VxWorks 6.9

Contributor Info - All information REQUIRED for consideration of pull request
Joseph Hickey, Vantage Systems, Inc.

In case the system-provided math.h header does not provide an
implementation if isnan or isfinite, use a local workaround.
* - isfinite assumes float type
* - both macros evaluate the argument twice - use only with a simple variable
*/
#ifndef isnan

Check notice

Code scanning / CodeQL

Conditional compilation Note

Use of conditional compilation must be kept to a minimum.
#ifndef isnan
#define isnan(x) ((x) != (x))
#endif
#ifndef isfinite

Check notice

Code scanning / CodeQL

Conditional compilation Note

Use of conditional compilation must be kept to a minimum.
@dzbaker dzbaker merged commit ca47670 into nasa:main Aug 17, 2023
17 checks passed
@dmknutsen dmknutsen added this to the Equuleus milestone Aug 23, 2023
@jphickey jphickey deleted the fix-95-isnan branch November 16, 2023 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Obsolete C libraries may not provide isnan/isfinite macros
4 participants