[Avida-SVN] r3481 - branches/tcmalloc-1.4/source/platform/tcmalloc-1.4

brysonda at myxo.css.msu.edu brysonda at myxo.css.msu.edu
Wed Oct 14 13:30:14 PDT 2009


Author: brysonda
Date: 2009-10-14 16:30:14 -0400 (Wed, 14 Oct 2009)
New Revision: 3481

Modified:
   branches/tcmalloc-1.4/source/platform/tcmalloc-1.4/sysinfo.cc
Log:
Add missing CHECK_LT definition.

Modified: branches/tcmalloc-1.4/source/platform/tcmalloc-1.4/sysinfo.cc
===================================================================
--- branches/tcmalloc-1.4/source/platform/tcmalloc-1.4/sysinfo.cc	2009-10-14 20:25:07 UTC (rev 3480)
+++ branches/tcmalloc-1.4/source/platform/tcmalloc-1.4/sysinfo.cc	2009-10-14 20:30:14 UTC (rev 3481)
@@ -460,9 +460,20 @@
 #if defined __linux__ || defined __FreeBSD__ || defined __sun__ || defined __CYGWIN__ || defined __CYGWIN32__
 static void ConstructFilename(const char* spec, pid_t pid,
                               char* buf, int buf_size) {
+#define CHECK_OP(op, val1, val2)                                        \
+  do {                                                                  \
+    if (!((val1) op (val2))) {                                          \
+      fprintf(stderr, "Check failed: %s %s %s\n", #val1, #op, #val2);   \
+      exit(1);                                                          \
+    }                                                                   \
+  } while (0)
+#define CHECK_LT(val1, val2) CHECK_OP(< , val1, val2)
+  
   CHECK_LT(snprintf(buf, buf_size,
                     spec,
                     pid ? pid : getpid()), buf_size);
+#undef CHECK_OP
+#undef CHECK_LT
 }
 #endif
 




More information about the Avida-cvs mailing list