mirror of
https://github.com/mutouyun/cpp-ipc.git
synced 2025-12-06 16:56:45 +08:00
compile error for vs2015 (TBD)
This commit is contained in:
parent
b76375633c
commit
0d948b9dfd
@ -1,9 +1,9 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
#include <algorithm>
|
||||||
|
|
||||||
#include "def.h"
|
#include "def.h"
|
||||||
#include "platform/detail.h"
|
|
||||||
|
|
||||||
namespace ipc {
|
namespace ipc {
|
||||||
|
|
||||||
@ -37,7 +37,11 @@ struct id_type<0, AlignSize> {
|
|||||||
};
|
};
|
||||||
|
|
||||||
template <std::size_t DataSize = 0,
|
template <std::size_t DataSize = 0,
|
||||||
std::size_t AlignSize = ipc::detail::min_val(DataSize, alignof(std::size_t))>
|
#if __cplusplus >= 201703L
|
||||||
|
std::size_t AlignSize = (std::min)(DataSize, alignof(std::size_t))>
|
||||||
|
#else /*__cplusplus < 201703L*/
|
||||||
|
std::size_t AlignSize = (alignof(std::size_t) < DataSize) ? alignof(std::size_t) : DataSize>
|
||||||
|
#endif/*__cplusplus < 201703L*/
|
||||||
class id_pool {
|
class id_pool {
|
||||||
public:
|
public:
|
||||||
enum : std::size_t {
|
enum : std::size_t {
|
||||||
|
|||||||
@ -23,7 +23,11 @@ using namespace ipc;
|
|||||||
using msg_id_t = std::size_t;
|
using msg_id_t = std::size_t;
|
||||||
|
|
||||||
template <std::size_t DataSize,
|
template <std::size_t DataSize,
|
||||||
std::size_t AlignSize = ipc::detail::min_val(DataSize, alignof(std::size_t))>
|
#if __cplusplus >= 201703L
|
||||||
|
std::size_t AlignSize = (std::min)(DataSize, alignof(std::size_t))>
|
||||||
|
#else /*__cplusplus < 201703L*/
|
||||||
|
std::size_t AlignSize = (alignof(std::size_t) < DataSize) ? alignof(std::size_t) : DataSize>
|
||||||
|
#endif/*__cplusplus < 201703L*/
|
||||||
struct msg_t;
|
struct msg_t;
|
||||||
|
|
||||||
template <std::size_t AlignSize>
|
template <std::size_t AlignSize>
|
||||||
|
|||||||
@ -10,8 +10,6 @@
|
|||||||
#include "def.h"
|
#include "def.h"
|
||||||
#include "rw_lock.h"
|
#include "rw_lock.h"
|
||||||
|
|
||||||
#include "platform/detail.h"
|
|
||||||
|
|
||||||
namespace ipc {
|
namespace ipc {
|
||||||
namespace mem {
|
namespace mem {
|
||||||
|
|
||||||
@ -150,7 +148,11 @@ public:
|
|||||||
using alloc_policy = AllocP;
|
using alloc_policy = AllocP;
|
||||||
|
|
||||||
enum : std::size_t {
|
enum : std::size_t {
|
||||||
block_size = ipc::detail::max_val(BlockSize, sizeof(void*))
|
#if __cplusplus >= 201703L
|
||||||
|
block_size = (std::max)(BlockSize, sizeof(void*))
|
||||||
|
#else /*__cplusplus < 201703L*/
|
||||||
|
block_size = (BlockSize < sizeof(void*)) ? sizeof(void*) : BlockSize
|
||||||
|
#endif/*__cplusplus < 201703L*/
|
||||||
};
|
};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
@ -82,16 +82,6 @@ constexpr auto shared_lock(T&& lc) {
|
|||||||
|
|
||||||
#endif/*__cplusplus < 201703L*/
|
#endif/*__cplusplus < 201703L*/
|
||||||
|
|
||||||
template <typename T>
|
|
||||||
constexpr T const & max_val(const T& a, const T& b) {
|
|
||||||
return a < b ? b : a;
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename T>
|
|
||||||
constexpr T const & min_val(const T& a, const T& b) {
|
|
||||||
return b < a ? b : a;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::size_t calc_unique_id();
|
std::size_t calc_unique_id();
|
||||||
|
|
||||||
template <typename F, typename D>
|
template <typename F, typename D>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user