[llvm-commits] CVS: llvm/lib/System/Unix/Path.cpp

Reid Spencer reid at x10sys.com
Sun Dec 26 22:17:26 PST 2004



Changes in directory llvm/lib/System/Unix:

Path.cpp updated: 1.28 -> 1.29
---
Log message:

For PR351: http://llvm.cs.uiuc.edu/PR351 :
* Ensure #includes are wrapped with appropriate HAVE_ guards
* Ensure variations in "dirent" structure are accounted for.


---
Diffs of the changes:  (+25 -1)

Index: llvm/lib/System/Unix/Path.cpp
diff -u llvm/lib/System/Unix/Path.cpp:1.28 llvm/lib/System/Unix/Path.cpp:1.29
--- llvm/lib/System/Unix/Path.cpp:1.28	Fri Dec 24 00:29:42 2004
+++ llvm/lib/System/Unix/Path.cpp	Mon Dec 27 00:17:15 2004
@@ -18,11 +18,35 @@
 
 #include "llvm/Config/alloca.h"
 #include "Unix.h"
+#if HAVE_SYS_STAT_H
 #include <sys/stat.h>
+#endif
+#if HAVE_FCNTL_H
 #include <fcntl.h>
+#endif
+#if HAVE_UTIME_H
 #include <utime.h>
-#include <dirent.h>
+#endif
+#if HAVE_TIME_H
 #include <time.h>
+#endif
+#if HAVE_DIRENT_H
+# include <dirent.h>
+# define NAMLEN(dirent) strlen((dirent)->d_name)
+#else
+# define dirent direct
+# define NAMLEN(dirent) (dirent)->d_namlen
+# if HAVE_SYS_NDIR_H
+#  include <sys/ndir.h>
+# endif
+# if HAVE_SYS_DIR_H
+#  include <sys/dir.h>
+# endif
+# if HAVE_NDIR_H
+#  include <ndir.h>
+# endif
+#endif
+
 
 namespace llvm {
 using namespace sys;






More information about the llvm-commits mailing list