summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2014-06-07 12:02:31 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2014-06-07 12:02:31 +0200
commitad63d0c777b344cccc6f5f4e9dbeda2c96e1a87a (patch)
tree0b264e0cb4938a8b21ca25cdf188ad85a169fb22
parent3f61f5d1b061ca22ee8cccdc19df8ecddd23c8b2 (diff)
Add missing defines.
-rw-r--r--src/path.cc52
1 files changed, 3 insertions, 49 deletions
diff --git a/src/path.cc b/src/path.cc
index 08565fd..1b4ede3 100644
--- a/src/path.cc
+++ b/src/path.cc
@@ -26,33 +26,9 @@
*/
#include "path.h"
-#ifndef WIN32
-
+#ifndef __MINGW32__
#include <libgen.h>
-
-#else/*WIN32*/
-
-#ifndef _MAX_DIR
-#define _MAX_DIR 256
-#endif
-
-#ifndef _MAX_DRIVE
-#define _MAX_DRIVE 3
-#endif
-
-#ifndef _MAX_EXT
-#define _MAX_EXT 256
-#endif
-
-#ifndef _MAX_FNAME
-#define _MAX_FNAME 256
-#endif
-
-#ifndef _MAX_PATH
-#define _MAX_PATH 260
-#endif
-
-#endif/*WIN32*/
+#endif/*__MINGW32__*/
#include <string.h>
#include <stdlib.h>
@@ -60,7 +36,7 @@
std::string getPath(std::string file)
{
std::string p;
-#ifndef WIN32
+#ifndef __MINGW32__
char *b = strdup(file.c_str());
p = dirname(b);
free(b);
@@ -73,25 +49,3 @@ std::string getPath(std::string file)
return p;
}
-
-#ifdef TEST_PATH
-//Additional dependency files
-//deps:
-//Required cflags (autoconf vars may be used)
-//cflags:
-//Required link options (autoconf vars may be used)
-//libs:
-#include "test.h"
-
-TEST_BEGIN;
-
-std::string a = "../dir/file";
-TEST_EQUAL_STR(getPath(a), "../dir", "relative path");
-
-std::string b = "/abs/path/file";
-TEST_EQUAL_STR(getPath(b), "/abs/path", "absolute path");
-
-
-TEST_END;
-
-#endif/*TEST_PATH*/