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().
This commit is contained in:
Joe Thornber 2015-01-16 10:48:19 +00:00
parent ef517035f1
commit f1130198e1
2 changed files with 4 additions and 3 deletions

View File

@ -1,5 +1,6 @@
#include "base/application.h"
#include <libgen.h>
#include <linux/limits.h>
#include <string.h>
@ -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];

View File

@ -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<command const *> cmds_;
};