From ad63d0c777b344cccc6f5f4e9dbeda2c96e1a87a Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Sat, 7 Jun 2014 12:02:31 +0200 Subject: Add missing defines. --- src/path.cc | 52 +++------------------------------------------------- 1 file 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 - -#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 #include @@ -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*/ -- cgit v1.2.3