summaryrefslogtreecommitdiffstats
path: root/package/upmpdcli/0001-Use-uint64_t-instead-of-u_int64_t.patch
blob: 69e05827ceec58b4395acb96b41a6923b3b6f8bf (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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
From 256394399f57ba6e3057ee2c981127a14e4623f8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=B6rg=20Krause?= <joerg.krause@embedded.rocks>
Date: Tue, 22 Jan 2019 09:07:56 +0100
Subject: [PATCH] Use uint64_t instead of u_int64_t
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

`uintN_t` is standard C99 type available in `<stdint.h>`, whereas `u_intN_t`
is defined `<sys/types.h>`

As upmpdcli already uses the `uintN_t` type, replace the few existing
`u_intN_t` types, as it breaks build with the musl C library, which is
very strict, because of the missing `<sys/types.h>`:

```
src/mediaserver/cdplugins/netfetch.h:71:5: error: ‘u_int64_t’ does not name a type
     u_int64_t datacount() {
```

Backported from: 256394399f57ba6e3057ee2c981127a14e4623f8

Signed-off-by: Jörg Krause <joerg.krause@embedded.rocks>
---
 src/mediaserver/cdplugins/netfetch.h | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/mediaserver/cdplugins/netfetch.h b/src/mediaserver/cdplugins/netfetch.h
index d7e9df4..d105e53 100644
--- a/src/mediaserver/cdplugins/netfetch.h
+++ b/src/mediaserver/cdplugins/netfetch.h
@@ -68,7 +68,7 @@ public:
     /// Reset after transfer done, for retrying for exemple.
     virtual bool reset() = 0;
 
-    u_int64_t datacount() {
+    uint64_t datacount() {
         return fetch_data_count;
     }
 
@@ -84,11 +84,11 @@ public:
         buf1cb = f;
     }
     // Called when the network transfer is done
-    void setEOFetchCB(std::function<void(bool ok, u_int64_t count)> f) {
+    void setEOFetchCB(std::function<void(bool ok, uint64_t count)> f) {
         eofcb = f;
     }
     // Called every time we get new data from the remote
-    void setFetchBytesCB(std::function<void(u_int64_t count)> f) {
+    void setFetchBytesCB(std::function<void(uint64_t count)> f) {
         fbcb = f;
     }
 
@@ -98,11 +98,11 @@ protected:
     std::string _url;
     uint64_t startoffset;
     int timeoutsecs{0};
-    u_int64_t fetch_data_count{0};
+    uint64_t fetch_data_count{0};
     BufXChange<ABuffer*> *outqueue{nullptr};
     std::function<bool(std::string&, void *, int)> buf1cb;
-    std::function<void(u_int64_t)> fbcb;
-    std::function<void(bool, u_int64_t)> eofcb;
+    std::function<void(uint64_t)> fbcb;
+    std::function<void(bool, uint64_t)> eofcb;
 };
 
 #endif /* _MEDIAFETCH_H_INCLUDED_ */
-- 
2.20.1

OpenPOWER on IntegriCloud