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

Proposal: Remove long long support #463

Merged
merged 3 commits into from
Nov 25, 2019
Merged

Proposal: Remove long long support #463

merged 3 commits into from
Nov 25, 2019

Conversation

minad
Copy link
Member

@minad minad commented Nov 22, 2019

I propose to simply remove long long functions, since it is not c89 and u64/i64 can be used instead everywhere. I think that would work for most people. See also the table https://de.wikipedia.org/wiki/Datentypen_in_C#Datenmodell

These functions have been originally added in 2014 by @sjaeckel with the name mp_get_long_long etc.
Then I turned them in a macro in #285, which I think would still be an acceptable solution. Afterwards they were made explicit symbols by @nijtmans in #321. Now it seems @nijtmans needs some MSC_VER ifdef guards around these functions.

Would that work for you @nijtmans?

Copy link
Collaborator

@nijtmans nijtmans left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, I'm already preparing to made the switch to (u)int64_t for Tcl, I kind of saw this coming already ;-). So, just go ahead, as long as you don't backport this to support/1.x.

@minad
Copy link
Member Author

minad commented Nov 22, 2019

@nijtmans We would only deprecate the functions in 1.x.

I also thought about making mp_get_ul macros pointing to either u32 or u64 as it has been before your PR #321. However one thing I realized and I am not too happy about is the selection of the function using the ternary operator, which again relies on dead code elimination. While we have that too for the MP_HAS macro, there it is purely a library internal thing. Here mp_get_ul is public api.

* they are non standard
* they are incompatible with older compilers
* u64/i64 functions should be used instead
* these functions should be deprecated again in 1.x
@sjaeckel
Copy link
Member

This needs a sibling patch for 1.x #418

@sjaeckel sjaeckel merged commit 220a4de into develop Nov 25, 2019
@sjaeckel sjaeckel deleted the long_long_fixes branch November 25, 2019 10:18
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