|
From: <sv...@va...> - 2007-11-26 00:41:54
|
Author: sewardj
Date: 2007-11-26 00:41:54 +0000 (Mon, 26 Nov 2007)
New Revision: 7223
Log:
Program uses too many new-ish constructions to be compilable on glibc 2.2
(Red Hat 7.3). Do nothing on very old platforms.
Modified:
trunk/exp-drd/tests/sigalrm.cpp
Modified: trunk/exp-drd/tests/sigalrm.cpp
===================================================================
--- trunk/exp-drd/tests/sigalrm.cpp 2007-11-26 00:11:04 UTC (rev 7222)
+++ trunk/exp-drd/tests/sigalrm.cpp 2007-11-26 00:41:54 UTC (rev 7223)
@@ -4,13 +4,20 @@
#include <cstdlib>
#include <ctime>
#include <iostream>
+#include <features.h>
#include <pthread.h>
#include <signal.h>
#include <unistd.h>
+#include <string.h>
#include "../drd_clientreq.h"
#include <asm/unistd.h>
+#if !defined(__GLIBC_PREREQ)
+# error "This program requires __GLIBC_PREREQ (in /usr/include/features.h)"
+#endif
+#if __GLIBC_PREREQ(2,3)
+
#define VALGRIND_START_NEW_SEGMENT \
{ \
int res; \
@@ -18,7 +25,6 @@
pthread_self(), 0, 0,0,0); \
}
-
static bool s_debug = false;
@@ -95,3 +101,13 @@
return 0;
}
+
+#else /* !__GLIBC_PREREQ(2,3) */
+
+int main(int argc, char** )
+{
+ std::cout << "program does not work on glibc < 2.3" << std::endl;
+ return 0;
+}
+
+#endif /* __GLIBC_PREREQ(2,3) */
|