[lsan] Allow using ucontext.h in the test on OSX.
authorAlexander Potapenko <glider@google.com>
Mon, 21 Jul 2014 13:35:09 +0000 (13:35 +0000)
committerAlexander Potapenko <glider@google.com>
Mon, 21 Jul 2014 13:35:09 +0000 (13:35 +0000)
llvm-svn: 213523

compiler-rt/test/lsan/TestCases/swapcontext.cc

index 1bb6057..f7e95ed 100644 (file)
@@ -6,6 +6,11 @@
 // RUN: not %run %t foo 2>&1 | FileCheck %s
 
 #include <stdio.h>
+#if defined(__APPLE__)
+// Note: ucontext.h is deprecated on OSX, so this test may stop working
+// someday. We define _XOPEN_SOURCE to keep using ucontext.h for now.
+#define _XOPEN_SOURCE 1
+#endif
 #include <ucontext.h>
 #include <unistd.h>