Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ibrcommon: fix build on musl #2120

Merged
merged 1 commit into from
Dec 14, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion libs/ibrcommon/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk

PKG_NAME:=ibrcommon
PKG_VERSION:=1.0.1
PKG_RELEASE:=1
PKG_RELEASE:=2

PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://www.ibr.cs.tu-bs.de/projects/ibr-dtn/releases
Expand Down
23 changes: 23 additions & 0 deletions libs/ibrcommon/patches/001-fix-build-with-musl.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
diff --git a/ibrcommon/data/File.cpp b/ibrcommon/data/File.cpp
index 31af4ae..9b49890 100644
--- a/ibrcommon/data/File.cpp
+++ b/ibrcommon/data/File.cpp
@@ -35,9 +35,7 @@
#include <cerrno>
#include <fstream>

-#if !defined(HAVE_FEATURES_H) || defined(ANDROID)
#include <libgen.h>
-#endif

#ifdef __WIN32__
#include <io.h>
@@ -226,7 +224,7 @@ namespace ibrcommon
std::string File::getBasename() const
{
#if !defined(ANDROID) && defined(HAVE_FEATURES_H)
- return std::string(basename(_path.c_str()));
+ return std::string(basename((char *)_path.c_str()));
#else
char path[_path.length()+1];
::memcpy(&path, _path.c_str(), _path.length()+1);