1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

Fix utest fail for C++11 or C++14

This commit is contained in:
winlin 2020-07-30 19:26:28 +08:00
parent 8e22508057
commit 0408040ed7
2 changed files with 7 additions and 2 deletions

View file

@ -49,7 +49,7 @@ USER_DIR = .
CPPFLAGS += -I\$(GTEST_DIR)/include CPPFLAGS += -I\$(GTEST_DIR)/include
# Flags passed to the C++ compiler. # Flags passed to the C++ compiler.
CXXFLAGS += ${CXXFLAGS} -Wextra ${UTEST_EXTRA_DEFINES} CXXFLAGS += ${CXXFLAGS} ${UTEST_EXTRA_DEFINES} -Wno-unused-private-field -Wno-unused-command-line-argument
# All tests produced by this Makefile. Remember to add new tests you # All tests produced by this Makefile. Remember to add new tests you
# created to the list. # created to the list.

View file

@ -24,6 +24,12 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#ifndef SRS_UTEST_PUBLIC_SHARED_HPP #ifndef SRS_UTEST_PUBLIC_SHARED_HPP
#define SRS_UTEST_PUBLIC_SHARED_HPP #define SRS_UTEST_PUBLIC_SHARED_HPP
// Before define the private/protected, we must include some system header files.
// Or it may fail with:
// redeclared with different access struct __xfer_bufptrs
// @see https://stackoverflow.com/questions/47839718/sstream-redeclared-with-public-access-compiler-error
#include "gtest/gtest.h"
// Public all private and protected members. // Public all private and protected members.
#define private public #define private public
#define protected public #define protected public
@ -33,7 +39,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
#include <srs_core.hpp> #include <srs_core.hpp>
#include "gtest/gtest.h"
#include <string> #include <string>
using namespace std; using namespace std;