Skip to content

Commit c141e7a

Browse files
committed
Fix some gcc-4.4-isms, should build now on 4.1+.
1 parent 211d419 commit c141e7a

File tree

4 files changed

+10
-2
lines changed

4 files changed

+10
-2
lines changed

src/rt/rust_internal.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ extern "C" {
3838
#include <pthread.h>
3939
#include <errno.h>
4040
#include <dirent.h>
41+
42+
#define GCC_VERSION (__GNUC__ * 10000 \
43+
+ __GNUC_MINOR__ * 100 \
44+
+ __GNUC_PATCHLEVEL__)
45+
4146
#else
4247
#error "Platform not supported."
4348
#endif

src/rt/rust_kernel.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@
33
#define __STDC_LIMIT_MACROS 1
44
#endif
55

6-
#include <vector>
76
#include "rust_internal.h"
87
#include "rust_util.h"
98
#include "rust_scheduler.h"
109

10+
#include <vector>
11+
1112
#define KLOG_(...) \
1213
KLOG(this, kern, __VA_ARGS__)
1314
#define KLOG_ERR_(field, ...) \

src/rt/rust_upcall.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@
3434
// the rust stack and happen frequently enough to catch most stack changes,
3535
// including at the beginning of all landing pads.
3636
// FIXME: Enable this for windows
37-
#if defined __linux__ || defined __APPLE__ || defined __FreeBSD__
37+
#if (defined __linux__ || defined __APPLE__ || defined __FreeBSD__) \
38+
&& (defined(GCC_VERSION) && GCC_VERSION > 40300)
3839
extern "C" void
3940
check_stack_alignment() __attribute__ ((aligned (16)));
4041
#else

src/rt/util/indexed_list.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ template<typename T> class indexed_list {
4343
}
4444
virtual int32_t remove(T* value);
4545
virtual T * operator[](int32_t index);
46+
virtual ~indexed_list() {}
4647
};
4748

4849
template<typename T> int32_t

0 commit comments

Comments
 (0)