]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Make it possible to #include <valgrind/drd.h> after <valgrind/helgrind.h>
authorBart Van Assche <bvanassche@acm.org>
Thu, 8 Mar 2012 14:44:57 +0000 (14:44 +0000)
committerBart Van Assche <bvanassche@acm.org>
Thu, 8 Mar 2012 14:44:57 +0000 (14:44 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12429

drd/drd.h

index e5fc0315f1e12c82c234f6493fbd9f4a4282d922..9a4cfa12a200ba860fc96d3cc75e771759e4ccdd 100644 (file)
--- a/drd/drd.h
+++ b/drd/drd.h
  */
 /*@{*/
 
+#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.
    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
 /** 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, \
    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.
  */
 #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
    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.
  */