Skip to content

MAP: change strncpy to use macro MAP_STRNCPY#2420

Merged
andrew-platt merged 1 commit intoOpenFAST:devfrom
andrew-platt:b/map_strncpy_2
Sep 13, 2024
Merged

MAP: change strncpy to use macro MAP_STRNCPY#2420
andrew-platt merged 1 commit intoOpenFAST:devfrom
andrew-platt:b/map_strncpy_2

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
@andrew-platt andrew-platt deleted the b/map_strncpy_2 branch September 13, 2024 21:11
@andrew-platt andrew-platt mentioned this pull request Dec 24, 2024
38 tasks
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

Comments