[PATCH] [Tsan] Fix the getline_nohang.cc test to build on FreeBSD

Ed Maste emaste at freebsd.org
Wed Oct 8 08:12:43 PDT 2014


================
Comment at: test/tsan/getline_nohang.cc:5
@@ -4,1 +4,3 @@
 // See https://code.google.com/p/thread-sanitizer/issues/detail?id=47
+#if __FreeBSD__
+#define _WITH_GETLINE  // to declare getline()
----------------
glider wrote:
> Isn't "#ifdef __FreeBSD__" more common? (that doesn't make much difference however)
> 
> I've also noticed other #ifdef's for OpenBSD, DragonFlyBSD, NetBSD etc. in the codebase. Do you know if they also apply here?
> 
> Isn't "#ifdef FreeBSD" more common?

That's the style I would use, fwiw.

> I've also noticed other #ifdef's for OpenBSD, DragonFlyBSD, NetBSD etc. in the codebase. Do you know if they also apply here?

There's going to be a lot of tedious comparison work to be done to make this work across all *BSDs.

On the LLDB list we had a short discussion on having a general *BSD define, but did not reach a conclusion.  My take is that there's not a lot of value in adding other BSD defines for a small handful of cases (like this one, perhaps) if the overall functionality is nowhere near complete.

http://reviews.llvm.org/D5666






More information about the llvm-commits mailing list