-
Notifications
You must be signed in to change notification settings - Fork 404
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
Configurator: support both negative numbers and expressions in C imports #1731
Conversation
846b3a9
to
19248da
Compare
Well, #1726 does not use the sign-detection by the preprocessor, just compile time evaluation of constant expressions. |
Indeed! But this requires the constant to be evaluable by |
Signed-off-by: Etienne Millon <me@emillon.org>
Signed-off-by: Etienne Millon <me@emillon.org>
This reverts commit 606f25b. Signed-off-by: Etienne Millon <me@emillon.org>
Rather than using the preprocessor to determine the sign of a value, we store both `x` and `-x`. One of them has an all-digit representation. Closes ocaml#1720 Signed-off-by: Etienne Millon <me@emillon.org>
Signed-off-by: Etienne Millon <me@emillon.org>
19248da
to
4d73584
Compare
Are you sure the evaluation is by |
You can see #1720 for a description of the problem, but yes the idea is that |
Please see #1726 (the PR I was referring to in my earlier post), there are no |
Ah! My bad, I didn't see this one. I'll merge it and close this one. Sorry about the confusion! |
Rather than using the preprocessor to determine the sign of a value, we store both
x
and-x
. One of them has an all-digit representation.For example,
1234
is stored as"0000001234000000/.-,"
and-5678
is stored as"000000+*)(0000005678"
.We might be able to do better if we could encode the sign and absolute value in the preprocessor, but it seems tricky to do so in a portable way.
(cc @Chris00 @avsm)