forked from apache/brpc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix compile issues of unit tests with gcc5.* on ubuntu 16.04
- Loading branch information
1 parent
c0124ec
commit a6109be
Showing
2 changed files
with
20 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// Copyright (c) 2017 Baidu, Inc. | ||
// Author: Zhangyi Chen ([email protected]) | ||
|
||
#ifndef BUTIL_TEST_SSTREAM_WORKAROUND | ||
#define BUTIL_TEST_SSTREAM_WORKAROUND | ||
|
||
// defining private as public makes it fail to compile sstream with gcc5.x like this: | ||
// "error: ‘struct std::__cxx11::basic_stringbuf<_CharT, _Traits, _Alloc>:: | ||
// __xfer_bufptrs’ redeclared with different access" | ||
|
||
#ifdef private | ||
# undef private | ||
# include <sstream> | ||
# define private public | ||
#else | ||
# include <sstream> | ||
#endif | ||
|
||
#endif // BUTIL_TEST_SSTREAM_WORKAROUND |