[libcxx-commits] [libcxx] 037952f - [libcxx] Include <sys/time.h> in posix_compat.h

Petr Hosek via libcxx-commits libcxx-commits at lists.llvm.org
Wed Jun 21 09:10:08 PDT 2023


Author: Petr Hosek
Date: 2023-06-21T16:10:01Z
New Revision: 037952f6d4a58dd257b27dbd765acb2012f0c11c

URL: https://github.com/llvm/llvm-project/commit/037952f6d4a58dd257b27dbd765acb2012f0c11c
DIFF: https://github.com/llvm/llvm-project/commit/037952f6d4a58dd257b27dbd765acb2012f0c11c.diff

LOG: [libcxx] Include <sys/time.h> in posix_compat.h

posix_compat.h uses struct timeval which is defined in <sys/time.h>
but it doesn't include it. On most POSIX platforms like Linux or macOS,
that headers is transitively included by other headers like <sys/stat.h>,
but there are other platforms where this is not the case.

Differential Revision: https://reviews.llvm.org/D153384

Added: 
    

Modified: 
    libcxx/src/filesystem/posix_compat.h

Removed: 
    


################################################################################
diff  --git a/libcxx/src/filesystem/posix_compat.h b/libcxx/src/filesystem/posix_compat.h
index bddead75960d8..b44eeeecce0b2 100644
--- a/libcxx/src/filesystem/posix_compat.h
+++ b/libcxx/src/filesystem/posix_compat.h
@@ -40,6 +40,7 @@
 # include <unistd.h>
 # include <sys/stat.h>
 # include <sys/statvfs.h>
+# include <sys/time.h>
 #endif
 #include <stdlib.h>
 #include <time.h>


        


More information about the libcxx-commits mailing list