aboutsummaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-support/poppler/poppler/basename-include.patch
blob: 4a18ba35040b7b7a8e17639b950b4088807b60b0 (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
From 2ac679158062b14729f82f513fc7cafbb6f4f7a6 Mon Sep 17 00:00:00 2001
From: Randy MacLeod <Randy.MacLeod@windriver.com>
Date: Fri, 26 Jul 2019 14:26:54 -0400
Subject: [PATCH 3/3] Minic GNU basename() API for non-glibc library e.g. musl

Upstream-Status: Pending

Rework for poppler 0.90.1
Signed-off-by: Andreas Müller <schnitzeltony@gmail.com>

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Randy MacLeod <Randy.MacLeod@windriver.com>
---
 goo/gbasename.cc | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/goo/gbasename.cc b/goo/gbasename.cc
index 69236d8..3858415 100644
--- a/goo/gbasename.cc
+++ b/goo/gbasename.cc
@@ -46,6 +46,10 @@
 #include <cstdlib>
 #include <cstring>
 
+#if !defined(__GLIBC__)
+#define basename(src) (strrchr(src,'/') ? strrchr(src,'/')+1 : src)
+#endif
+
 std::string gbasename(const char *filename)
 {
 #ifdef _MSC_VER
-- 
2.21.3