Don't typedef types to the same name in different namespaces
authorChristopher Dykes <cdykes@fb.com>
Fri, 22 Jul 2016 17:13:30 +0000 (10:13 -0700)
committerFacebook Github Bot 1 <facebook-github-bot-1-bot@fb.com>
Fri, 22 Jul 2016 17:23:50 +0000 (10:23 -0700)
Summary:
This was causing MSVC to complain due to `DSched` already being declared in `BatonTestHelpers.h` as `::folly::DSched`, but it's then typedef'd again in `BatonTest.cpp`, this time as `::DSched`. MSVC complains about the duplicate definitions even though they resolve to the same type, so kill the one in the source file and keep the one in the header.
The same is the case with `GroupVarint32Decoder` and `GroupVarint64Decoder`, which are both declared in `GroupVarint.h` and then again, this time in an anon namespace, in `GroupVarintTest.cpp`.

Reviewed By: yfeldblum

Differential Revision: D3600948

fbshipit-source-id: 401790aa918289fe4a34dd5af683f8c6ca50d847

folly/test/BatonTest.cpp
folly/test/GroupVarintTest.cpp

index dfe604ed191254b238cc321551fdc803644a066f..eaeb5ad69a2c768ab4624fb08cb11d03d05b7547 100644 (file)
@@ -25,8 +25,6 @@ using namespace folly;
 using namespace folly::test;
 using folly::detail::EmulatedFutexAtomic;
 
-typedef DeterministicSchedule DSched;
-
 TEST(Baton, basic) {
   Baton<> b;
   b.post();
index fa3bc117beea59f621fd0be6b041939559891f43..8b05713ce2655ee9ca315d06aa2c54b0f27282d7 100644 (file)
@@ -39,8 +39,6 @@ class StringAppender {
 
 typedef GroupVarintEncoder<uint32_t, StringAppender> GroupVarint32Encoder;
 typedef GroupVarintEncoder<uint64_t, StringAppender> GroupVarint64Encoder;
-typedef GroupVarintDecoder<uint32_t> GroupVarint32Decoder;
-typedef GroupVarintDecoder<uint32_t> GroupVarint64Decoder;
 
 // Expected bytes follow, terminate with -1
 void testGroupVarint32(uint32_t a, uint32_t b, uint32_t c, uint32_t d, ...) {