-
Notifications
You must be signed in to change notification settings - Fork 198
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
#311 with macros #313
#311 with macros #313
Conversation
I also thought about that before. Maybe let's discuss this in a separate PR, also with respect to #301 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good 👍
Sorry, couldn't resist ;-) But serious: There are five macros for 12 functions of which 6 are essentially one2one, I doubt the ROI is very high in this one ;-)
Yeah, would get more complicated, would need to run the preprocessor over them, too (or use the Perl module I mentioned elsewhere, but that is not in a standard installation), especially for @minad 's Although it would be much easier for me if the macros were already expanded in the individual files ;-) |
This is somehow the point. These macros are useful to generate more functions of this class. But I am 100% with you, that as of now the ROI is very low. I expressed my doubts before. However I would still keep them internal for now. If a user is interested, they can take tommath_private.h and generate more functions if needed.
Cool, let's discuss this in #301. I am really looking forward to this amalgamation feature + static functions, since this allows to embed tommath.h inside a c file with full global optimization :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I like it. Something like this I had in mind. Thank you very much!
7a836d4
to
b6b5618
Compare
Just sat down to adapt #301 to this PR. Not that much of a problem but: your current version insists on GCC doing the preprocessor work. That is a bit too restrictive, even for me. Some alternatives:
Although I prefer the last alternative—obviously ;-)—the first one is probably the quickest to implement. |
@czurnieden what about using env $CC and fallback to gcc? I would like to avoid heavy perl dependencies if possible. |
I don't know if Static files, on the other side, would be completely without any such headaches! ;-) |
Please don't overcomplicate things. makefile.unix also relies on CC and the file regeneration can always be done in a unix like environment. #301 seems already more complicated in contrast to what we have now, but I have to take a closer look soon. |
@sjaeckel I took the liberty and added a few commits improving helper.pl - in particular sorting the dependencies in tommath_class.h. This makes it easier to see changes during regeneration. The gcc preprocessing looks good 👍 I think you can merge this. The only downside I am seeing is the slowdown during --update-makefiles. |
@sjaeckel If you don't like the commits, feel free to revert - I can also move this stuff to another PR if desired. |
9a491aa
to
352d496
Compare
Can we also get rid of the trickery with |
@karel-m done. Now it should be possible to update your no-stdint branch. |
(Well, using static files would be the least complicated ;-) ) LTM builds on more OSs than just the Unix-likes. It is more portable to offer an additional option to pass the correct command instead of relying on environment variables only. It's Perl, you won't need to add more than three or four lines to do it. |
@fperrad can you please put your linter commits on top, if there are none please only approve :) |
62b65af
to
1dd3911
Compare
btw @karel-m if you add your modification-script to helper.pl we can add more build-jobs to appveyor that first modify the sources and then build them (at least with the msvc available there) |
1dd3911
to
f5b2106
Compare
thx btw @minad for the improvements :-) |
96f451f
to
d1013c7
Compare
Alternative approach to #311
NB: I'm not 100% sure if the last commit
generate tommath_class from pre-processed code
is a good idea resp. if the results are even correct!