diff options
author | Wohlstand <admin@wohlnet.ru> | 2024-08-29 16:26:57 +0300 |
---|---|---|
committer | Wohlstand <admin@wohlnet.ru> | 2024-08-29 16:26:57 +0300 |
commit | c0ed6b879ac921ee822d39bc2ea550c731b73e4c (patch) | |
tree | 08c0deb604fb727fac79cbebe84f5aa1b6934885 | |
parent | f97b1719771fda4670d903527cb14ec2979df03b (diff) | |
download | libADLMIDI-c0ed6b879ac921ee822d39bc2ea550c731b73e4c.tar.gz libADLMIDI-c0ed6b879ac921ee822d39bc2ea550c731b73e4c.tar.bz2 libADLMIDI-c0ed6b879ac921ee822d39bc2ea550c731b73e4c.zip |
Fixed DOS build
-rw-r--r-- | utils/midiplay/adlmidiplay.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/utils/midiplay/adlmidiplay.cpp b/utils/midiplay/adlmidiplay.cpp index cef025a..6f2adea 100644 --- a/utils/midiplay/adlmidiplay.cpp +++ b/utils/midiplay/adlmidiplay.cpp @@ -43,6 +43,7 @@ # include <unistd.h> #endif +# define HAS_S_GETTIME static inline double s_getTime() { return SDL_GetTicks64() / 1000.0; @@ -575,7 +576,9 @@ static struct TimeCounter char totalHMS[25]; char loopStartHMS[25]; char loopEndHMS[25]; +#ifdef HAS_S_GETTIME char realHMS[25]; +#endif bool hasLoop; uint64_t milliseconds_prev; @@ -584,7 +587,9 @@ static struct TimeCounter int complete_prev; double totalTime; +#ifdef HAS_S_GETTIME double realTimeStart; +#endif #ifdef HARDWARE_OPL3 unsigned newTimerFreq; @@ -776,8 +781,10 @@ static struct TimeCounter { totalTime = total; secondsToHMSM(total, totalHMS, 25); +#ifdef HAS_S_GETTIME realTimeStart = s_getTime(); secondsToHMSM(s_getTime() - realTimeStart, realHMS, 25); +#endif } void setLoop(double loopStart, double loopEnd) @@ -808,9 +815,15 @@ static struct TimeCounter { printsCounter = -1; secondsToHMSM(pos, posHMS, 25); +#ifdef HAS_S_GETTIME secondsToHMSM(s_getTime() - realTimeStart, realHMS, 25); +#endif std::fprintf(stdout, " \r"); +#ifdef HAS_S_GETTIME std::fprintf(stdout, "Time position: %s / %s [Real time: %s]\r", posHMS, totalHMS, realHMS); +#else + std::fprintf(stdout, "Time position: %s / %s\r", posHMS, totalHMS); +#endif flushout(stdout); milliseconds_prev = milliseconds; } |