Conflict with st_dev/st_ino identifiers under Debian GNU/Hurd
authorSylvestre Ledru <sylvestre@debian.org>
Mon, 23 Apr 2012 16:37:23 +0000 (16:37 +0000)
committerSylvestre Ledru <sylvestre@debian.org>
Mon, 23 Apr 2012 16:37:23 +0000 (16:37 +0000)
The problem is that the struct file_status on UNIX systems has two
members called st_dev and st_ino; those are also members of the
struct stat, and they are reserved identifiers which can also be
provided as #define (and this is the case for st_dev on Hurd).
The solution (attached) is to rename them, for example adding a
"fs_" prefix (= file status) to them.

Patch by Pino Toscano

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@155354 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Support/FileSystem.h
lib/Support/Unix/PathV2.inc

index e6f9926af6f8972ae017c6cd07f8ba83dd6bdeef..3fd5301d032420321c5ab90b72f93e8f3dc48b40 100644 (file)
@@ -99,8 +99,8 @@ struct space_info {
 class file_status
 {
   #if defined(LLVM_ON_UNIX)
-  dev_t st_dev;
-  ino_t st_ino;
+  dev_t fs_st_dev;
+  ino_t fs_st_ino;
   #elif defined (LLVM_ON_WIN32)
   uint32_t LastWriteTimeHigh;
   uint32_t LastWriteTimeLow;
index edb101efb0f692b5390a00b8cf1f755a9dda9991..5f22f8e674a1e080a69d064fcff38a2ac5aba1f5 100644 (file)
@@ -285,8 +285,8 @@ error_code exists(const Twine &path, bool &result) {
 
 bool equivalent(file_status A, file_status B) {
   assert(status_known(A) && status_known(B));
-  return A.st_dev == B.st_dev &&
-         A.st_ino == B.st_ino;
+  return A.fs_st_dev == B.fs_st_dev &&
+         A.fs_st_ino == B.fs_st_ino;
 }
 
 error_code equivalent(const Twine &A, const Twine &B, bool &result) {
@@ -340,8 +340,8 @@ error_code status(const Twine &path, file_status &result) {
   else
     result = file_status(file_type::type_unknown);
 
-  result.st_dev = status.st_dev;
-  result.st_ino = status.st_ino;
+  result.fs_st_dev = status.st_dev;
+  result.fs_st_ino = status.st_ino;
 
   return error_code::success();
 }