about summary refs log tree commit diff
diff options
context:
space:
mode:
authorBrian Anderson <banderson@mozilla.com>2012-03-12 18:03:10 -0700
committerBrian Anderson <banderson@mozilla.com>2012-03-12 18:03:48 -0700
commit3de30f4ef2f535b4cec24bba6166b8275d8400af (patch)
tree498db7d55cf3edb752ecb5ba6e3953384320786b
parentdd610a151bfde75e496d5bbaef95b63bd52bb822 (diff)
downloadrust-3de30f4ef2f535b4cec24bba6166b8275d8400af.tar.gz
rust-3de30f4ef2f535b4cec24bba6166b8275d8400af.zip
rt: Change alignof to rust_alignof. Remove -Wno-c++11-compat. Closes #1644
-rw-r--r--mk/platform.mk3
-rw-r--r--src/rt/rust_shape.cpp6
-rw-r--r--src/rt/rust_shape.h18
3 files changed, 13 insertions, 14 deletions
diff --git a/mk/platform.mk b/mk/platform.mk
index 2afe8872a67..ee09a4811a6 100644
--- a/mk/platform.mk
+++ b/mk/platform.mk
@@ -210,8 +210,7 @@ ifeq ($(CFG_C_COMPILER),clang)
   CC=clang
   CXX=clang++
   CPP=cpp
-  # -Wno-c++11-compat allows us to use 'alignof' as an identifier in the runtime
-  CFG_GCCISH_CFLAGS += -Wall -Werror -Wno-c++11-compat -fno-rtti -g
+  CFG_GCCISH_CFLAGS += -Wall -Werror -fno-rtti -g
   CFG_GCCISH_LINK_FLAGS += -g
   CFG_DEPEND_C = $(CFG_GCCISH_CROSS)$(CXX) $(CFG_GCCISH_CFLAGS) -MT "$(1)" \
     -MM $(2)
diff --git a/src/rt/rust_shape.cpp b/src/rt/rust_shape.cpp
index ef53a7ca7fa..9883400d173 100644
--- a/src/rt/rust_shape.cpp
+++ b/src/rt/rust_shape.cpp
@@ -212,7 +212,7 @@ size_of::compute_tag_size(tag_info &tinfo) {
             tinfo.tag_sa.set(1, 1);
     } else {
         // Add in space for the tag.
-        tinfo.tag_sa.add(sizeof(tag_variant_t), alignof<tag_align_t>());
+        tinfo.tag_sa.add(sizeof(tag_variant_t), rust_alignof<tag_align_t>());
     }
 }
 
@@ -277,7 +277,7 @@ private:
     }
 
     inline void cmp_two_pointers() {
-        ALIGN_TO(alignof<void *>());
+        ALIGN_TO(rust_alignof<void *>());
         data_pair<uint8_t *> fst = bump_dp<uint8_t *>(dp);
         data_pair<uint8_t *> snd = bump_dp<uint8_t *>(dp);
         cmp_number(fst);
@@ -286,7 +286,7 @@ private:
     }
 
     inline void cmp_pointer() {
-        ALIGN_TO(alignof<void *>());
+        ALIGN_TO(rust_alignof<void *>());
         cmp_number(bump_dp<uint8_t *>(dp));
     }
 
diff --git a/src/rt/rust_shape.h b/src/rt/rust_shape.h
index 29c65a2d55f..64de224464e 100644
--- a/src/rt/rust_shape.h
+++ b/src/rt/rust_shape.h
@@ -108,7 +108,7 @@ public:
 
 template<typename T>
 inline size_t
-alignof() {
+rust_alignof() {
 #ifdef _MSC_VER
     return __alignof(T);
 #else
@@ -118,7 +118,7 @@ alignof() {
 
 template<>
 inline size_t
-alignof<double>() {
+rust_alignof<double>() {
     return 4;
 }
 
@@ -649,7 +649,7 @@ public:
     }
 
     template<typename T>
-    void walk_number1()  { sa.set(sizeof(T), alignof<T>()); }
+    void walk_number1()  { sa.set(sizeof(T), rust_alignof<T>()); }
 
     void compute_tag_size(tag_info &tinfo);
 
@@ -851,7 +851,7 @@ namespace shape {
     }
 
 #define DATA_SIMPLE(ty, call) \
-    ALIGN_TO(alignof<ty>()); \
+    ALIGN_TO(rust_alignof<ty>()); \
     U end_dp = dp + sizeof(ty); \
     static_cast<T *>(this)->call; \
     dp = end_dp;
@@ -899,21 +899,21 @@ public:
     void walk_uniq1() { DATA_SIMPLE(void *, walk_uniq2()); }
 
     void walk_fn1(char code) {
-        ALIGN_TO(alignof<void *>());
+        ALIGN_TO(rust_alignof<void *>());
         U next_dp = dp + sizeof(void *) * 2;
         static_cast<T *>(this)->walk_fn2(code);
         dp = next_dp;
     }
 
     void walk_iface1() {
-        ALIGN_TO(alignof<void *>());
+        ALIGN_TO(rust_alignof<void *>());
         U next_dp = dp + sizeof(void *);
         static_cast<T *>(this)->walk_iface2();
         dp = next_dp;
     }
 
     void walk_tydesc1(char kind) {
-        ALIGN_TO(alignof<void *>());
+        ALIGN_TO(rust_alignof<void *>());
         U next_dp = dp + sizeof(void *);
         static_cast<T *>(this)->walk_tydesc2(kind);
         dp = next_dp;
@@ -938,7 +938,7 @@ public:
     template<typename WN>
     void walk_number1() { 
         //DATA_SIMPLE(W, walk_number2<W>());
-        ALIGN_TO(alignof<WN>());
+        ALIGN_TO(rust_alignof<WN>());
         U end_dp = dp + sizeof(WN);
         T* t = static_cast<T *>(this);
         t->template walk_number2<WN>();
@@ -1003,7 +1003,7 @@ data<T,U>::walk_tag1(tag_info &tinfo) {
     size_of::compute_tag_size(*this, tinfo);
 
     if (tinfo.variant_count > 1)
-        ALIGN_TO(alignof<tag_align_t>());
+        ALIGN_TO(rust_alignof<tag_align_t>());
 
     U end_dp = dp + tinfo.tag_sa.size;