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

MAP: change strncpy to use macro MAP_STRNCPY #2420

Merged
merged 1 commit into from
Sep 13, 2024

Conversation

andrew-platt
Copy link
Collaborator

Ready to merge.

Feature or improvement description
Some compilers do not support the strncpy_s routine. Replacing this call with a call to a macro who's definition is based on which compiler is in use. This new macro MAP_STRNCPY is based on the MAP_STRCPY macro and points to either strncpy or strncpy_s.

Related issue, if one exists
Supersedes PR #2417
Original issue mentioned in comment here: 93e2d27#r14664285 from PR #2394

Impacted areas of the software
MAP module compilation only

Additional supporting information
Evidently incompatibilities between MSVC and gcc were run into before. I suspect this is why @mmasciol added the macro definitions for MAP_STRCPY during initial MAP development in ~2011.

Test results, if applicable
No tests exist for this, so nothing changes.

Similar to how macro MAP_STRCPY works, MAP_STRNCPY points to either strncpy or strncpy_s depending on compiler used
@andrew-platt
Copy link
Collaborator Author

@sanguinariojoe, we think this may be a solution that is more consistent with the existing code.

@andrew-platt andrew-platt merged commit f59b46e into OpenFAST:dev Sep 13, 2024
21 checks passed
@andrew-platt andrew-platt deleted the b/map_strncpy_2 branch September 13, 2024 21:11
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.

2 participants