MusicPlayerDaemon / mpdscribble

a MPD client which submits information about tracks being played to a scrobbler (e.g. last.fm)
GNU General Public License v2.0
114 stars 15 forks source link

Fix build with GCC 12 (missing <time.h> include) #42

Closed thesamesam closed 2 years ago

thesamesam commented 2 years ago

Fixes the following build failure with GCC 12:

FAILED: mpdscribble.p/src_Log.cxx.o
[...]
../mpdscribble-0.24/src/Log.cxx: In function ‘const char* log_date()’:
../mpdscribble-0.24/src/Log.cxx:48:13: error: ‘time’ was not declared in this scope
   48 |         t = time(nullptr);
      |             ^~~~
../mpdscribble-0.24/src/Log.cxx:49:15: error: ‘localtime’ was not declared in this scope
   49 |         tmp = localtime(&t);
      |               ^~~~~~~~~
../mpdscribble-0.24/src/Log.cxx:55:14: error: ‘strftime’ was not declared in this scope
   55 |         if (!strftime(buf, sizeof(buf), "%Y-%m-%dT%H:%M:%S%z", tmp)) {
      |              ^~~~~~~~

Bug: https://bugs.gentoo.org/851513