blob: 7a6a247d73d0051e42d732d387563a6eee7027e1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
https://github.com/MusicPlayerDaemon/mpdscribble/pull/42
From: Sam James <sam@gentoo.org>
Date: Sun, 12 Jun 2022 11:11:08 +0100
Subject: [PATCH] Fix build with GCC 12 (missing <time.h> include)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
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
--- a/src/Log.cxx
+++ b/src/Log.cxx
@@ -29,6 +29,7 @@
#include <stdio.h>
#include <string.h>
#include <errno.h>
+#include <time.h>
#ifdef HAVE_SYSLOG
#include <syslog.h>
|