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

Updates to handle POSIX extensions #38

Merged
merged 2 commits into from
Nov 8, 2023
Merged

Updates to handle POSIX extensions #38

merged 2 commits into from
Nov 8, 2023

Conversation

drsteve
Copy link
Owner

@drsteve drsteve commented Nov 8, 2023

Two non-standard extensions were used in the code:

  • IsoTimeStringToDateTime uses strptime which is a POSIX extension and not C standard. I've informed the preprocessor using the appropriate define.
  • Tsyg2007 used sincos, which is a non-standard extension supplied by glibc (and possibly others). Since the code already had an implementation (mysincos) that was used in a number of places - including all through Tsyg2004 - I've switched the remaining calls to use mysincos.

Notes for future:

  1. strptime won't work on windows (native, not WSL/cygwin) if we want to make sure we can support that we'll need to provide a workaround.
  2. The use of mysincos is unnecessary and these calls should be switched to using adjacent calls to sin and cos that the preprocessor can optimize to sincos if it's available.

Added note to switch all of these to just using
sin and cos together as the preprocessor will
handle using sincos if it's available.
On systems that don't have the non-compliant
extension the use of sincos is a problem
@drsteve drsteve merged commit dbeabd2 into master Nov 8, 2023
1 check passed
@drsteve drsteve deleted the posix_extensions branch November 8, 2023 17:50
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

Successfully merging this pull request may close these issues.

1 participant