[libcxx-commits] [PATCH] D153384: [libcxx] Include <sys/time.h> in posix_compat.h

Petr Hosek via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Jun 20 15:42:52 PDT 2023


phosek created this revision.
phosek added a reviewer: ldionne.
Herald added a project: All.
phosek requested review of this revision.
Herald added a project: libc++.
Herald added a subscriber: libcxx-commits.
Herald added a reviewer: libc++.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D153384

Files:
  libcxx/src/filesystem/posix_compat.h


Index: libcxx/src/filesystem/posix_compat.h
===================================================================
--- libcxx/src/filesystem/posix_compat.h
+++ 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>


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D153384.533069.patch
Type: text/x-patch
Size: 357 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20230620/b78f62e5/attachment.bin>


More information about the libcxx-commits mailing list