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:
		| @@ -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]; | ||||
|  | ||||
|   | ||||
| @@ -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_; | ||||
| 	}; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user