bump _POSIX_C_SOURCE to 200809L, remove _XOPEN_SOURCE #1

Merged
gavin merged 1 commits from e5ten/bc:posix-c into master 2 years ago
e5ten commented 2 years ago

With the previous _POSIX_C_SOURCE=200112L, strdup was the only function that was unavailable without _XOPEN_SOURCE=600, increase _POSIX_C_SOURCE version to make it so _XOPEN_SOURCE can be removed and the source can be completely POSIX compatible.

With the previous `_POSIX_C_SOURCE=200112L`, strdup was the only function that was unavailable without `_XOPEN_SOURCE=600`, increase `_POSIX_C_SOURCE` version to make it so `_XOPEN_SOURCE` can be removed and the source can be completely POSIX compatible.
Poster

Alternatively, if you would prefer the POSIX requirement stay at 2001, I could just replace the one actual strdup call with a malloc+memcpy, and then _POSIX_C_SOURCE=200112L without _XOPEN_SOURCE will be sufficient.

Alternatively, if you would prefer the POSIX requirement stay at 2001, I could just replace the one actual strdup call with a malloc+memcpy, and then `_POSIX_C_SOURCE=200112L` without `_XOPEN_SOURCE` will be sufficient.
e5ten closed this pull request 2 years ago
e5ten reopened this pull request 2 years ago
gavin closed this pull request 2 years ago
Owner

Thanks. I apologize for the waffling.

Thanks. I apologize for the waffling.
Poster

No problem, it was a tough choice!

No problem, it was a tough choice!
Owner

Oh, I should note that even though I have made improvements to bc apart from this PR, I won't be releasing a new version for a while. Expect about two or three months.

Oh, I should note that even though I have made improvements to `bc` apart from this PR, I won't be releasing a new version for a while. Expect about two or three months.
Owner

So...it turns out that LONG_BIT is also under X/Open System Interfaces. And I need this one because it defaults to the minimum of 32 if it doesn't exist.

Because of that, I have to undo this PR merge and go back to using XSI. And since I am doing that, might as well go back to POSIX 2001 and XSI 600.

So...it turns out that `LONG_BIT` is also under X/Open System Interfaces. And I need this one because it defaults to the minimum of 32 if it doesn't exist. Because of that, I have to undo this PR merge and go back to using XSI. And since I am doing that, might as well go back to POSIX 2001 and XSI 600.
The pull request has been merged as a054de4b1e.
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No Assignees
2 Participants
Notifications
Due Date

No due date set.

Dependencies

This pull request currently doesn't have any dependencies.

Loading…
There is no content yet.