Make it possible to #include <valgrind/drd.h> after <valgrind/helgrind.h>

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12429 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/drd/drd.h b/drd/drd.h
index e5fc031..9a4cfa1 100644
--- a/drd/drd.h
+++ b/drd/drd.h
@@ -108,6 +108,8 @@
  */
 /*@{*/
 
+#ifndef __HELGRIND_H
+
 /**
  * Tell DRD to insert a happens-before mark. addr is the address of an object
  * that is not a pthread synchronization object.
@@ -128,6 +130,36 @@
    VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__DRD_ANNOTATE_HAPPENS_AFTER, \
                                    addr, 0, 0, 0, 0)
 
+#else /* __HELGRIND_H */
+
+#undef ANNOTATE_CONDVAR_LOCK_WAIT
+#undef ANNOTATE_CONDVAR_WAIT
+#undef ANNOTATE_CONDVAR_SIGNAL
+#undef ANNOTATE_CONDVAR_SIGNAL_ALL
+#undef ANNOTATE_PURE_HAPPENS_BEFORE_MUTEX
+#undef ANNOTATE_PUBLISH_MEMORY_RANGE
+#undef ANNOTATE_BARRIER_INIT
+#undef ANNOTATE_BARRIER_WAIT_BEFORE
+#undef ANNOTATE_BARRIER_WAIT_AFTER
+#undef ANNOTATE_BARRIER_DESTROY
+#undef ANNOTATE_PCQ_CREATE
+#undef ANNOTATE_PCQ_DESTROY
+#undef ANNOTATE_PCQ_PUT
+#undef ANNOTATE_PCQ_GET
+#undef ANNOTATE_BENIGN_RACE
+#undef ANNOTATE_BENIGN_RACE_SIZED
+#undef ANNOTATE_IGNORE_READS_BEGIN
+#undef ANNOTATE_IGNORE_READS_END
+#undef ANNOTATE_IGNORE_WRITES_BEGIN
+#undef ANNOTATE_IGNORE_WRITES_END
+#undef ANNOTATE_IGNORE_READS_AND_WRITES_BEGIN
+#undef ANNOTATE_IGNORE_READS_AND_WRITES_END
+#undef ANNOTATE_NEW_MEMORY
+#undef ANNOTATE_TRACE_MEMORY
+#undef ANNOTATE_THREAD_NAME
+
+#endif /* __HELGRIND_H */
+
 /**
  * Tell DRD that waiting on the condition variable at address cv has succeeded
  * and a lock on the mutex at address mtx is now held. Since DRD always inserts
@@ -181,6 +213,8 @@
 /** Deprecated -- don't use this annotation. */
 #define ANNOTATE_SWAP_MEMORY_RANGE(addr, size) do { } while(0)
 
+#ifndef __HELGRIND_H
+
 /** Tell DRD that a reader-writer lock object has been initialized. */
 #define ANNOTATE_RWLOCK_CREATE(rwlock)                                     \
    VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__DRD_ANNOTATE_RWLOCK_CREATE, \
@@ -200,6 +234,8 @@
    VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__DRD_ANNOTATE_RWLOCK_ACQUIRED, \
                                    rwlock, is_w, 0, 0, 0)
 
+#endif /* __HELGRIND_H */
+
 /**
  * Tell DRD that a reader lock has been acquired on a reader-writer
  * synchronization object.
@@ -212,6 +248,8 @@
  */
 #define ANNOTATE_WRITERLOCK_ACQUIRED(rwlock) ANNOTATE_RWLOCK_ACQUIRED(rwlock, 1)
 
+#ifndef __HELGRIND_H
+
 /**
  * Tell DRD that a reader-writer lock is about to be released. is_w == 1 means
  * that a write lock is about to be released, is_w == 0 means that a read lock
@@ -221,6 +259,8 @@
    VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__DRD_ANNOTATE_RWLOCK_RELEASED, \
                                    rwlock, is_w, 0, 0, 0);
 
+#endif /* __HELGRIND_H */
+
 /**
  * Tell DRD that a reader lock is about to be released.
  */