[llvm-commits] AddressSanitizer: remove pthread.h and signal.h on Mac in favor of declarations (issue 5671052)
samsonov at google.com
samsonov at google.com
Wed Feb 15 02:10:22 PST 2012
Reviewers: kcc, ramosian.glider, timurrrr_at_google_com,
Message:
Kostya,
just to make sure - is this CL fine on a path of cleaning asan .cc files
from system headers (on Apple)?
http://codereview.appspot.com/5671052/diff/1/asan_interceptors.cc
File asan_interceptors.cc (right):
http://codereview.appspot.com/5671052/diff/1/asan_interceptors.cc#newcode19
asan_interceptors.cc:19: #include "asan_mac.h"
Oops, probably we should get rid of this as well somehow?
Description:
AddressSanitizer: remove pthread.h and signal.h on Mac in favor of
declarations
Please review this at http://codereview.appspot.com/5671052/
Affected files:
M asan_interceptors.cc
Index: asan_interceptors.cc
===================================================================
--- asan_interceptors.cc (revision 150573)
+++ asan_interceptors.cc (working copy)
@@ -34,11 +34,17 @@
#if defined(__APPLE__)
// FIXME(samsonov): Gradually replace system headers with declarations of
-// intercepted functions.
-#include <pthread.h>
-#include <signal.h>
+// intercepted functions. We need this declarations on Mac to get
addresses of
+// the functions to intercept.
#include <string.h>
#include <strings.h>
+
+extern "C" {
+int pthread_create(void *thread, const void *attr,
+ void *(*start_routine)(void*), void *arg);
+int sigaction(int signum, const void *act, void *oldact);
+} // extern "C"
+
#endif // __APPLE__
namespace __asan {
More information about the llvm-commits
mailing list