Skip to content

[CF] Implement strlcpy and strlcat once in Prefix. #2599

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

Merged
merged 1 commit into from
Jan 11, 2020

Conversation

3405691582
Copy link
Member

strlcpy and strlcat implementations are required for:

  • LINUX, but not ANDROID nor CYGWIN (since ANDROID and CYGWIN
    are both LINUX),
  • WIN32.

Instead of implementing strlcpy and strlcat once per TARGET_OS when
required, just write the implementation once and modify the conditional.

This does mean the ifdef conditional is a little complicated, but
overall that is outweighed by the removal of the obvious redundancy
and will eventually improve the handling of TARGET_OS_BSD.

strlcpy and strlcat implementations are required for:
* LINUX, but not ANDROID nor CYGWIN (since ANDROID and CYGWIN
  are both LINUX),
* WIN32.

Instead of implementing strlcpy and strlcat once per TARGET_OS when
required, just write the implementation once and modify the conditional.

This does mean the ifdef conditional is a little complicated, but
overall that is outweighed by the removal of the obvious redundancy
and will eventually improve the handling of TARGET_OS_BSD.
@spevans
Copy link
Contributor

spevans commented Jan 9, 2020

@swift-ci test

@compnerd
Copy link
Member

@swift-ci please test Linux platform

@3405691582
Copy link
Member Author

Can someone retest for me? I think swift/#29121 might have fixed the Linux bot.

@spevans
Copy link
Contributor

spevans commented Jan 11, 2020

@swift-ci test linux

@compnerd compnerd merged commit 56fa338 into swiftlang:master Jan 11, 2020
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.

3 participants