Przeglądaj źródła

Modify tests to compile on AIX with xlC compiler.

- `int64` typedef collision with `sys/inttypes.h`
- `xlC` complains about `int` and pointer comparisons without casts
Andrew Paprocki 11 lat temu
rodzic
commit
af88ccb5fc

+ 2 - 2
src/google/protobuf/repeated_field.h

@@ -1307,11 +1307,11 @@ class RepeatedPtrIterator
     it_ += d;
     it_ += d;
     return *this;
     return *this;
   }
   }
-  friend iterator operator+(iterator it, difference_type d) {
+  friend iterator operator+(iterator it, const difference_type d) {
     it += d;
     it += d;
     return it;
     return it;
   }
   }
-  friend iterator operator+(difference_type d, iterator it) {
+  friend iterator operator+(const difference_type d, iterator it) {
     it += d;
     it += d;
     return it;
     return it;
   }
   }

+ 3 - 0
src/google/protobuf/stubs/type_traits_unittest.cc

@@ -41,7 +41,10 @@
 #include <gtest/gtest.h>
 #include <gtest/gtest.h>
 
 
 typedef int int32;
 typedef int int32;
+// IBM AIX typedefs `int64` in `sys/inttypes.h`, included transitively above.
+#ifndef _AIX
 typedef long int64;
 typedef long int64;
+#endif
 
 
 using std::string;
 using std::string;
 using std::vector;
 using std::vector;