@@ -20,57 +20,16 @@ static pthread_mutex_t dg_mutex = PTHREAD_MUTEX_INITIALIZER;
harness.h injects macros before including <dejagnu.h> so that the
pass/fail functions become "dejagnu_pass"/"dejagnu_fail" etc. */
-void dejagnu_pass (const char* fmt, ...);
-void dejagnu_fail (const char* fmt, ...);
-void dejagnu_note (const char* fmt, ...);
-
-/* We now provide our own implementations of "pass"/"fail"/"note", which
- call the underlying dejagnu implementations, but with a mutex. */
+/* Forward decls of our implementations of pass/fail/note. */
inline void
-pass (const char* fmt, ...)
-{
- va_list ap;
- char buffer[512];
-
- va_start (ap, fmt);
- vsnprintf (buffer, sizeof (buffer), fmt, ap);
- va_end (ap);
-
- pthread_mutex_lock (&dg_mutex);
- dejagnu_pass (buffer);
- pthread_mutex_unlock (&dg_mutex);
-}
+pass (const char* fmt, ...);
inline void
-fail (const char* fmt, ...)
-{
- va_list ap;
- char buffer[512];
-
- va_start (ap, fmt);
- vsnprintf (buffer, sizeof (buffer), fmt, ap);
- va_end (ap);
-
- pthread_mutex_lock (&dg_mutex);
- dejagnu_fail (buffer);
- pthread_mutex_unlock (&dg_mutex);
-}
+fail (const char* fmt, ...);
inline void
-note (const char* fmt, ...)
-{
- va_list ap;
- char buffer[512];
-
- va_start (ap, fmt);
- vsnprintf (buffer, sizeof (buffer), fmt, ap);
- va_end (ap);
-
- pthread_mutex_lock (&dg_mutex);
- dejagnu_note (buffer);
- pthread_mutex_unlock (&dg_mutex);
-}
+note (const char* fmt, ...);
#define MAKE_DEJAGNU_H_THREADSAFE
@@ -91,6 +50,54 @@ note (const char* fmt, ...)
#undef COMBINED_TEST
#include "harness.h"
+/* We now provide our own implementations of "pass"/"fail"/"note", which
+ call the underlying dejagnu implementations, but with a mutex. */
+
+inline void
+pass (const char* fmt, ...)
+{
+ va_list ap;
+ char buffer[512];
+
+ va_start (ap, fmt);
+ vsnprintf (buffer, sizeof (buffer), fmt, ap);
+ va_end (ap);
+
+ pthread_mutex_lock (&dg_mutex);
+ dejagnu_pass (buffer);
+ pthread_mutex_unlock (&dg_mutex);
+}
+
+inline void
+fail (const char* fmt, ...)
+{
+ va_list ap;
+ char buffer[512];
+
+ va_start (ap, fmt);
+ vsnprintf (buffer, sizeof (buffer), fmt, ap);
+ va_end (ap);
+
+ pthread_mutex_lock (&dg_mutex);
+ dejagnu_fail (buffer);
+ pthread_mutex_unlock (&dg_mutex);
+}
+
+inline void
+note (const char* fmt, ...)
+{
+ va_list ap;
+ char buffer[512];
+
+ va_start (ap, fmt);
+ vsnprintf (buffer, sizeof (buffer), fmt, ap);
+ va_end (ap);
+
+ pthread_mutex_lock (&dg_mutex);
+ dejagnu_note (buffer);
+ pthread_mutex_unlock (&dg_mutex);
+}
+
struct thread_data
{
pthread_t m_tid;