From f1130198e14d99f7f5805e661367e985b7f8a4f8 Mon Sep 17 00:00:00 2001 From: Joe Thornber Date: Fri, 16 Jan 2015 10:48:19 +0000 Subject: [PATCH] include libgen.h in application.cc for the declaration of basename. Unfortunately it defines basename as a macro, so also change member function name from basename() to get_basename(). --- base/application.cc | 5 +++-- base/application.h | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/base/application.cc b/base/application.cc index 6012e06..9e1f0dd 100644 --- a/base/application.cc +++ b/base/application.cc @@ -1,5 +1,6 @@ #include "base/application.h" +#include #include #include @@ -11,7 +12,7 @@ using namespace std; int application::run(int argc, char **argv) { - string cmd = basename(argv[0]); + string cmd = get_basename(argv[0]); if (cmd == string("pdata_tools")) { argc--; @@ -49,7 +50,7 @@ application::usage() } std::string -application::basename(std::string const &path) const +application::get_basename(std::string const &path) const { char buffer[PATH_MAX + 1]; diff --git a/base/application.h b/base/application.h index 8585129..d01eb36 100644 --- a/base/application.h +++ b/base/application.h @@ -41,7 +41,7 @@ namespace base { private: void usage(); - std::string basename(std::string const &path) const; + std::string get_basename(std::string const &path) const; std::list cmds_; };