Closed guigzzz closed 7 years ago
Yes, this is inherited from the C version, which uses GNU autotools to manage configuration. So the normal C build version is the standard:
./configure # Make config.h and gdefconfig.h
make # Actually build it
For the purposes of the coursework I tried to get something static that would work "most places", so tried to restrict it to a common set of choices.
So I punted that everyone would be using a compiler where
long long
is 64-bit - I'm not sure of any modern production x86 compiler
where that isn't true, so it seemed a safe choice.
I've been trying to figure out how to start optimising the code. When looking at the code, I often see this preprocessor directive. By pure curiosity I wanted to see how it was defined: It is apparently defined in
testu01/include/gdef.h
:HAVE_LONGLONG
which is checked in the first line of my screenshot, is unconditionally defined as being 1 intestu01/include/gdefconf.h
This seems weird to me as the directives seem to defineUSE_LONGLONG
twice, once in theifdef HAVE_LONGLONG
, and once again unconditionally on line 47 of my screenshot. As a consequence it would seem that defining the same thing twice doesn't present any problem to the compiler (or I'm reading the code incorrectly). What I also don't understand is whyUSE_LONGLONG
is needed in this case if the directive is going to be defined without checking that the compiler/host actully supports 64bit integers. Is this inherited code from the C version of this library? Or is there something that I am missing here?