Commits

Anonymous committed 46d08f1

ENH: Add an accessor for the maximum file length

  • Participants
  • Parent commits e252a79
  • Tags Afterspeedup, Beforespeedup

Comments (0)

Files changed (1)

GCC_XML/KWSys/SystemTools.cxx

 #include <io.h>
 #include <direct.h>
 #define _unlink unlink
+#endif 
+
+/* The maximum length of a file name.  */
+#if defined(PATH_MAX)
+# define KWSYS_SYSTEMTOOLS_MAXPATH PATH_MAX
+#elif defined(MAXPATHLEN)
+# define KWSYS_SYSTEMTOOLS_MAXPATH MAXPATHLEN
+#else
+# define KWSYS_SYSTEMTOOLS_MAXPATH 16384
+#endif
+
+#if defined(_WIN32) && (defined(_MSC_VER) || defined(__BORLANDC__) || defined(__MINGW32__))
 inline int Mkdir(const char* dir)
 {
   return _mkdir(dir);
 }
 inline void Realpath(const char *path, kwsys_stl::string & resolved_path)
 {
-# ifdef MAXPATHLEN
-  char resolved_name[MAXPATHLEN];
-# else
-#  ifdef PATH_MAX
-  char resolved_name[PATH_MAX];
-#  else
-  char resolved_name[5024];
-#  endif  //PATH_MAX
-# endif //MAXPATHLEN
+  char resolved_name[KWSYS_SYSTEMTOOLS_MAXPATH];
 
   realpath(path, resolved_name);
   resolved_path = resolved_name;
 {
 };
 
+
 double
 SystemTools::GetTime(void)
 {
 }
 
 /**
+ */
+size_t SystemTools::GetMaximumFilePathLength()
+{
+  return KWSYS_SYSTEMTOOLS_MAXPATH;
+}
+
+/**
  * Find the file the given name.  Searches the given path and then
  * the system search path.  Returns the full path to the file if it is
  * found.  Otherwise, the empty string is returned.