summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAliaksey Kandratsenka <alkondratenko@gmail.com>2017-05-14 20:24:27 -0700
committerAliaksey Kandratsenka <alkondratenko@gmail.com>2017-05-14 20:35:22 -0700
commit53f15325d93fbe0ba17bb3fac3da86ffd3f0f1ad (patch)
treea6c7e445953d94d030db4a73c054941bc7105fab
parentb1d88662cb4a38ee47aa48076745898033526f9d (diff)
downloadgperftools-53f15325d93fbe0ba17bb3fac3da86ffd3f0f1ad.tar.gz
fix compilation of tcmalloc_unittest.cc on older llvm-gcc
-rw-r--r--src/tests/tcmalloc_unittest.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/tests/tcmalloc_unittest.cc b/src/tests/tcmalloc_unittest.cc
index 0bf18e7..712cb1b 100644
--- a/src/tests/tcmalloc_unittest.cc
+++ b/src/tests/tcmalloc_unittest.cc
@@ -1079,8 +1079,14 @@ struct GlobalNallocx {
#if defined(__GNUC__)
+#if defined(__APPLE__)
+// llvm-gcc on older osex that I have access to, doesn't like arg-ful
+// constructor attribute.
+static void check_global_nallocx() __attribute__((constructor));
+#else
// 101 is the max user priority.
static void check_global_nallocx() __attribute__((constructor(101)));
+#endif
static void check_global_nallocx() { CHECK_GT(nallocx(99, 0), 99); }
#endif // __GNUC__