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:
parent
ef517035f1
commit
f1130198e1
@ -1,5 +1,6 @@
|
|||||||
#include "base/application.h"
|
#include "base/application.h"
|
||||||
|
|
||||||
|
#include <libgen.h>
|
||||||
#include <linux/limits.h>
|
#include <linux/limits.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
@ -11,7 +12,7 @@ using namespace std;
|
|||||||
int
|
int
|
||||||
application::run(int argc, char **argv)
|
application::run(int argc, char **argv)
|
||||||
{
|
{
|
||||||
string cmd = basename(argv[0]);
|
string cmd = get_basename(argv[0]);
|
||||||
|
|
||||||
if (cmd == string("pdata_tools")) {
|
if (cmd == string("pdata_tools")) {
|
||||||
argc--;
|
argc--;
|
||||||
@ -49,7 +50,7 @@ application::usage()
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::string
|
std::string
|
||||||
application::basename(std::string const &path) const
|
application::get_basename(std::string const &path) const
|
||||||
{
|
{
|
||||||
char buffer[PATH_MAX + 1];
|
char buffer[PATH_MAX + 1];
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@ namespace base {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
void usage();
|
void usage();
|
||||||
std::string basename(std::string const &path) const;
|
std::string get_basename(std::string const &path) const;
|
||||||
|
|
||||||
std::list<command const *> cmds_;
|
std::list<command const *> cmds_;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user