mirror of
https://github.com/mutouyun/cpp-ipc.git
synced 2025-12-06 16:56:45 +08:00
修正一些bug
This commit is contained in:
parent
c32615dbda
commit
67bdae6fd7
@ -13,8 +13,6 @@ if(NOT MSVC)
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O2")
|
||||
endif()
|
||||
|
||||
add_definitions(-DLIBIPC_CPP_14 -DLIBIPC_CPP_17)
|
||||
|
||||
if (MSVC)
|
||||
set(CompilerFlags
|
||||
CMAKE_CXX_FLAGS
|
||||
|
||||
@ -85,7 +85,7 @@
|
||||
#if (__cplusplus >= 201703L) && !defined(LIBIPC_CPP_17)
|
||||
# define LIBIPC_CPP_17
|
||||
#endif
|
||||
#if (__cplusplus >= 201402L) && !defined(LIBIPC_CPP_14)
|
||||
#if /*(__cplusplus >= 201402L) &&*/ !defined(LIBIPC_CPP_14)
|
||||
# define LIBIPC_CPP_14
|
||||
#endif
|
||||
|
||||
@ -123,7 +123,7 @@
|
||||
#if !defined(LIBIPC_UNUSED)
|
||||
# if defined(LIBIPC_CC_GNUC)
|
||||
# define LIBIPC_UNUSED __attribute__((__unused__))
|
||||
# elif defined(LIBIPC_CC_MSVC_)
|
||||
# elif defined(LIBIPC_CC_MSVC)
|
||||
# define LIBIPC_UNUSED __pragma(warning(suppress: 4100 4101 4189))
|
||||
# else
|
||||
# define LIBIPC_UNUSED
|
||||
|
||||
@ -36,6 +36,18 @@ TEST(detect_plat, cc) {
|
||||
#endif
|
||||
}
|
||||
|
||||
TEST(detect_plat, cpp) {
|
||||
#if defined(LIBIPC_CPP_20)
|
||||
std::cout << "LIBIPC_CPP_20\n";
|
||||
#elif defined(LIBIPC_CPP_17)
|
||||
std::cout << "LIBIPC_CPP_17\n";
|
||||
#elif defined(LIBIPC_CPP_14)
|
||||
std::cout << "LIBIPC_CPP_14\n";
|
||||
#else
|
||||
ASSERT_TRUE(false);
|
||||
#endif
|
||||
}
|
||||
|
||||
TEST(detect_plat, byte_order) {
|
||||
auto is_endian_little = [] {
|
||||
union {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user