$Id$
*/
-
+#ifndef COMPILER_MSVC
#include <cstdio>
#include <cstring>
#include <string>
#include <cstring>
#include <limits.h>
-#include <pbd/mountpoint.h>
+#include "pbd/mountpoint.h"
using std::string;
-#ifdef HAVE_WAFCONFIG_H
-#include "wafconfig.h"
+#ifdef WAF_BUILD
+#include "libpbd-config.h"
#endif
-#if HAVE_GETMNTENT
+#ifdef HAVE_GETMNTENT
#include <mntent.h>
struct mntent_sorter {
return best;
}
+#elif defined(PLATFORM_WINDOWS)
+
+string
+mountpoint (string path)
+{
+ // TODO ... if needed
+}
+
#else // !HAVE_GETMNTENT
#include <sys/param.h>
const char *cpath = path.c_str();
char best[PATH_MAX+1];
+ /* From the manpage, under "BUGS" : "The memory allocated by getmntinfo() cannot be free(3)'d by the
+ application."
+
+ Thus: we do NOT try to free memory allocated by getmntinfo()
+ */
+
if ((count = getmntinfo(&mntbufp, MNT_NOWAIT)) == 0) {
- free(mntbufp);
return "\0";
}
if (cpath[matchlen] == '\0') {
snprintf(best, sizeof(best), "%s", mntbufp[i].f_mntonname);
- free(mntbufp);
return best;
} else {
}
}
}
-
- free(mntbufp);
return best;
}
}
#endif // TEST_MOUNTPOINT
+
+#else // COMPILER_MSVC
+ const char* pbd_mountpoint = "pbd/msvc/mountpoint.cc takes precedence over this file";
+#endif // COMPILER_MSVC