aboutsummaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-support/poppler/poppler/basename-include.patch
blob: c18a5f5c0ee33f0c4422ce5863c0429ce279dec7 (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
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

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 830c1c80..e93eb368 100644
--- a/goo/gbasename.cc
+++ b/goo/gbasename.cc
@@ -46,6 +46,10 @@
 #include <stdlib.h>
 #include <string.h>
 
+#if !defined(__GLIBC__)
+#define basename(src) (strrchr(src,'/') ? strrchr(src,'/')+1 : src)
+#endif
+
 std::string gbasename(const char* filename)
 {
 #ifdef _MSC_VER
-- 
2.17.0