How exactly does conditional compilation works in C?
I'm using GMP to do some calculations in a C program;
but if GMP isn't available in the machine, I could do the calculations with some handmade functions.
>>7
What happens if I use those flags in a makefile and then port this to a different OS that doesn't support GMP? Exactly. Perhaps you should shut up and try it before opening your mouth again.
Name:
Anonymous2012-02-05 13:05
If you do it during the compilation stage, you will not be able to distribute your binary. It is better to handle it at runtime, either via weak linking on platforms that support it, or by manually loading the dynamic library.
Though realistically, if you need GMP your own replacements aren't going to be worth shit.
Name:
Anonymous2012-02-05 13:08
>>8
why would you use CAN_HAS_GMP flag in a makefile?
Why do you purposefully try to break stuff?
Name:
Anonymous2012-02-05 13:10
>>9 If you do it during the compilation stage, you will not be able to distribute your binary.
If >>2 would have gotten the conditional guards right, it would have been possible to do this during the compilation state, and like uh... thus be able to distrube the binary. Geeze. Both you and >>2 speak from inexperience or some shit like that.
Name:
Anonymous2012-02-05 13:12
>>10
Because it's standard practice you idiot. Oh wait, you aren't aware of something like this because you don't work as a computer programmer. Instead, you're just some idiot toilet scrubber that googles shit.
>>21
Responding to a substandard troll, but..
With only compile-time checking, a binary build with GMP support will not run on a machine without GMP installed (unless you're linking statically, which you shouldn't). With runtime checks, you can gracefully fall back with reduced functionality.
>>30
I'm being serious. So once again, you're stupid. And once again, you have no possible future as a computer programmer. This is partly due to the fact that you're lazy and unmotivated.