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")
|
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O2")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_definitions(-DLIBIPC_CPP_14 -DLIBIPC_CPP_17)
|
|
||||||
|
|
||||||
if (MSVC)
|
if (MSVC)
|
||||||
set(CompilerFlags
|
set(CompilerFlags
|
||||||
CMAKE_CXX_FLAGS
|
CMAKE_CXX_FLAGS
|
||||||
|
|||||||
@ -85,7 +85,7 @@
|
|||||||
#if (__cplusplus >= 201703L) && !defined(LIBIPC_CPP_17)
|
#if (__cplusplus >= 201703L) && !defined(LIBIPC_CPP_17)
|
||||||
# define LIBIPC_CPP_17
|
# define LIBIPC_CPP_17
|
||||||
#endif
|
#endif
|
||||||
#if (__cplusplus >= 201402L) && !defined(LIBIPC_CPP_14)
|
#if /*(__cplusplus >= 201402L) &&*/ !defined(LIBIPC_CPP_14)
|
||||||
# define LIBIPC_CPP_14
|
# define LIBIPC_CPP_14
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -123,7 +123,7 @@
|
|||||||
#if !defined(LIBIPC_UNUSED)
|
#if !defined(LIBIPC_UNUSED)
|
||||||
# if defined(LIBIPC_CC_GNUC)
|
# if defined(LIBIPC_CC_GNUC)
|
||||||
# define LIBIPC_UNUSED __attribute__((__unused__))
|
# define LIBIPC_UNUSED __attribute__((__unused__))
|
||||||
# elif defined(LIBIPC_CC_MSVC_)
|
# elif defined(LIBIPC_CC_MSVC)
|
||||||
# define LIBIPC_UNUSED __pragma(warning(suppress: 4100 4101 4189))
|
# define LIBIPC_UNUSED __pragma(warning(suppress: 4100 4101 4189))
|
||||||
# else
|
# else
|
||||||
# define LIBIPC_UNUSED
|
# define LIBIPC_UNUSED
|
||||||
|
|||||||
@ -36,6 +36,18 @@ TEST(detect_plat, cc) {
|
|||||||
#endif
|
#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) {
|
TEST(detect_plat, byte_order) {
|
||||||
auto is_endian_little = [] {
|
auto is_endian_little = [] {
|
||||||
union {
|
union {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user