Link Windows exe statically, change location of std::flush
The Windows exe has to be linked statically, because Windows is stupid and doesn't have dynamic libraries like the stdc++ lib available. Maybe it's in some .dll somewhere, but I can't be bothered. Linux is just better. The change to the location of flush will make the output look more "spigot"-like, ie with large numbers of digits generated, the digits will be output in small groups instead of a nice smooth digit at a time. For some reason this is how most spigot algorithms do it, and so to me it "looks" correct. It doesn't actually change anything whatsoever other than when the standard output actually gets printed to console.
This commit is contained in:
parent
97018305fd
commit
bc12d981d0
2 changed files with 4 additions and 3 deletions
|
@ -2,7 +2,7 @@ CC=x86_64-w64-mingw32-gcc
|
||||||
CXX=x86_64-w64-mingw32-g++
|
CXX=x86_64-w64-mingw32-g++
|
||||||
RM=rm -f
|
RM=rm -f
|
||||||
CPPFLAGS=-Wall
|
CPPFLAGS=-Wall
|
||||||
LDFLAGS=
|
LDFLAGS=-static
|
||||||
LDLIBS=-lm
|
LDLIBS=-lm
|
||||||
|
|
||||||
SRCS=main.cpp Spigot.cpp
|
SRCS=main.cpp Spigot.cpp
|
||||||
|
|
|
@ -39,7 +39,7 @@ void Spigot::pump(void) {
|
||||||
// output all predigits
|
// output all predigits
|
||||||
long unsigned pdLen = this->preDigits.size();
|
long unsigned pdLen = this->preDigits.size();
|
||||||
for(long unsigned int j = 0; j < pdLen; j++) {
|
for(long unsigned int j = 0; j < pdLen; j++) {
|
||||||
std::cout << this->preDigits.back() << std::flush;
|
std::cout << this->preDigits.back();
|
||||||
this->preDigits.pop_back();
|
this->preDigits.pop_back();
|
||||||
}
|
}
|
||||||
this->preDigits.insert(this->preDigits.begin(), tempPreDigit);
|
this->preDigits.insert(this->preDigits.begin(), tempPreDigit);
|
||||||
|
@ -50,7 +50,7 @@ void Spigot::pump(void) {
|
||||||
tempPreDigit = 0;
|
tempPreDigit = 0;
|
||||||
long unsigned pdLen = this->preDigits.size();
|
long unsigned pdLen = this->preDigits.size();
|
||||||
for(long unsigned int j = 0; j < pdLen; j++) {
|
for(long unsigned int j = 0; j < pdLen; j++) {
|
||||||
std::cout << (this->preDigits.back() + 1) % 10 << std::flush;
|
std::cout << (this->preDigits.back() + 1) % 10;
|
||||||
this->preDigits.pop_back();
|
this->preDigits.pop_back();
|
||||||
}
|
}
|
||||||
this->preDigits.insert(this->preDigits.begin(), tempPreDigit);
|
this->preDigits.insert(this->preDigits.begin(), tempPreDigit);
|
||||||
|
@ -60,5 +60,6 @@ void Spigot::pump(void) {
|
||||||
} catch (int e) {
|
} catch (int e) {
|
||||||
std::cout << "An exception " << e << " occurred." << std::endl;
|
std::cout << "An exception " << e << " occurred." << std::endl;
|
||||||
}
|
}
|
||||||
|
std::cout << std::flush;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue