]> git.lyx.org Git - lyx.git/blobdiff - src/support/getcwd.C
hopefully fix tex2lyx linking.
[lyx.git] / src / support / getcwd.C
index 47d67fa2743a86f1068c8cd9b5ac2f7f185b7171..40b61a6a2609410f5e9e394ad683d5c580551182 100644 (file)
 #include <boost/scoped_array.hpp>
 
 #include <cerrno>
+
+
+namespace lyx {
 #ifdef HAVE_UNISTD_H
 # include <unistd.h>
 #endif
 
+#ifdef _WIN32
+# include <windows.h>
+#endif
+
 using boost::scoped_array;
 
 using std::string;
@@ -29,10 +36,11 @@ namespace {
 inline
 char * l_getcwd(char * buffer, size_t size)
 {
-#ifndef __EMX__
-       return ::getcwd(buffer, size);
+#ifdef _WIN32
+       GetCurrentDirectory(size, buffer);
+       return buffer;
 #else
-       return ::_getcwd2(buffer, size);
+       return ::getcwd(buffer, size);
 #endif
 }
 
@@ -58,3 +66,6 @@ string const lyx::support::getcwd()
                result = tbuf.get();
        return result;
 }
+
+
+} // namespace lyx