about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGraydon Hoare <graydon@mozilla.com>2012-03-28 13:49:39 -0700
committerGraydon Hoare <graydon@mozilla.com>2012-03-28 13:52:47 -0700
commitc141e7a068e3fbb1a5d24dcd000567b7731910bb (patch)
tree1760a7bc92475d235e623751c6ef493bcbbe7cad
parent211d41948a9f5bb4e6f322cb8639e01439e13abf (diff)
downloadrust-c141e7a068e3fbb1a5d24dcd000567b7731910bb.tar.gz
rust-c141e7a068e3fbb1a5d24dcd000567b7731910bb.zip
Fix some gcc-4.4-isms, should build now on 4.1+.
-rw-r--r--src/rt/rust_internal.h5
-rw-r--r--src/rt/rust_kernel.cpp3
-rw-r--r--src/rt/rust_upcall.cpp3
-rw-r--r--src/rt/util/indexed_list.h1
4 files changed, 10 insertions, 2 deletions
diff --git a/src/rt/rust_internal.h b/src/rt/rust_internal.h
index e5e4af73cab..c5afdd44ae0 100644
--- a/src/rt/rust_internal.h
+++ b/src/rt/rust_internal.h
@@ -38,6 +38,11 @@ extern "C" {
 #include <pthread.h>
 #include <errno.h>
 #include <dirent.h>
+
+#define GCC_VERSION (__GNUC__ * 10000 \
+                     + __GNUC_MINOR__ * 100 \
+                     + __GNUC_PATCHLEVEL__)
+
 #else
 #error "Platform not supported."
 #endif
diff --git a/src/rt/rust_kernel.cpp b/src/rt/rust_kernel.cpp
index 8e6baf99197..3b6ddbe4db2 100644
--- a/src/rt/rust_kernel.cpp
+++ b/src/rt/rust_kernel.cpp
@@ -3,11 +3,12 @@
 #define __STDC_LIMIT_MACROS 1
 #endif
 
-#include <vector>
 #include "rust_internal.h"
 #include "rust_util.h"
 #include "rust_scheduler.h"
 
+#include <vector>
+
 #define KLOG_(...)                              \
     KLOG(this, kern, __VA_ARGS__)
 #define KLOG_ERR_(field, ...)                   \
diff --git a/src/rt/rust_upcall.cpp b/src/rt/rust_upcall.cpp
index bc404ba9f1e..647927d5c4b 100644
--- a/src/rt/rust_upcall.cpp
+++ b/src/rt/rust_upcall.cpp
@@ -34,7 +34,8 @@
 // the rust stack and happen frequently enough to catch most stack changes,
 // including at the beginning of all landing pads.
 // FIXME: Enable this for windows
-#if defined __linux__ || defined __APPLE__ || defined __FreeBSD__
+#if (defined __linux__ || defined __APPLE__ || defined __FreeBSD__) \
+    && (defined(GCC_VERSION) && GCC_VERSION > 40300)
 extern "C" void
 check_stack_alignment() __attribute__ ((aligned (16)));
 #else
diff --git a/src/rt/util/indexed_list.h b/src/rt/util/indexed_list.h
index feea4d5d044..d58927156a6 100644
--- a/src/rt/util/indexed_list.h
+++ b/src/rt/util/indexed_list.h
@@ -43,6 +43,7 @@ public:
     }
     virtual int32_t remove(T* value);
     virtual T * operator[](int32_t index);
+    virtual ~indexed_list() {}
 };
 
 template<typename T> int32_t