[PATCH] D30010: Improve the robustness of mmap

Zachary Turner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 16 15:49:43 PST 2017


zturner added inline comments.


================
Comment at: llvm/lib/Support/Unix/Path.inc:68
 #include <sys/types.h>
-#if !defined(__APPLE__) && !defined(__OpenBSD__) && !defined(__ANDROID__)
+#if !defined(__APPLE__) && !defined(__OpenBSD__) && !defined(__FreeBSD__) &&   \
+    !defined(__ANDROID__)
----------------
krytarowski wrote:
> Is this equivalent to `defined(__linux__) || defined(__NetBSD__)`? If so it might look easier to parse presented this in the way of what system is used for this.
If you scroll down the file about 30 lines you'll see this:

```
#if defined(__FreeBSD__) || defined (__NetBSD__) || defined(__Bitrig__) || \
    defined(__OpenBSD__) || defined(__minix) || defined(__FreeBSD_kernel__) || \
    defined(__linux__) || defined(__CYGWIN__) || defined(__DragonFly__) || \
    defined(_AIX)
```

I don't know the ins and outs of all these definitions, but I'm pretty sure at least some of them will fall into this `#if` branch.  And there could even be other ones that are not listed here but which define other platforms.  So I'm not entirely sure what the inverse of this conditional is.


https://reviews.llvm.org/D30010





More information about the llvm-commits mailing list