-
Notifications
You must be signed in to change notification settings - Fork 7
/
rdestl_common.h
83 lines (67 loc) · 1.59 KB
/
rdestl_common.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#ifndef RDESTL_COMMON_H
#define RDESTL_COMMON_H
#ifndef RDESTL_STANDALONE
# define RDESTL_STANDALONE 1
#endif
#ifdef _MSC_VER
# if _MSC_VER < 1600
# error platform not supported
# elif _MSC_VER < 1700
# define RDE_COMPILER_MSVC_2010 1
# endif
#endif
#ifdef __cplusplus
# if __cplusplus <= 199711L // C++98 and earlier
# define RDE_HAS_CPP98 1
# elif __cplusplus >= 201103L // C++11 and later
# define RDE_HAS_CPP11 1
# endif
#endif
#if RDESTL_STANDALONE
# ifdef _MSC_VER
# define NOMINMAX
# undef min
# undef max
# ifndef _ALLOW_RTCc_IN_STL
# define _ALLOW_RTCc_IN_STL
# endif
# include <cassert>
# include <cstring>
# define RDE_FORCEINLINE __forceinline
# else
# include <assert.h>
# include <cstdlib>
# include <cstring>
# define RDE_FORCEINLINE inline
# endif
# ifdef _DEBUG
# undef RDE_DEBUG
# define RDE_DEBUG 1
# endif
# define RDE_ASSERT assert
#include <cstdint>
namespace rde
{
namespace Sys
{
RDE_FORCEINLINE void MemCpy(void* to, const void* from, size_t bytes)
{
std::memcpy(to, from, bytes);
}
RDE_FORCEINLINE void MemMove(void* to, const void* from, size_t bytes)
{
std::memmove(to, from, bytes);
}
RDE_FORCEINLINE void MemSet(void* buf, unsigned char value, size_t bytes)
{
std::memset(buf, value, bytes);
}
} // namespace Sys
} // namespace rde
#endif // #if RDESTL_STANDALONE
namespace rde
{
enum e_noinitialize { noinitialize };
} // namespace rde
//-----------------------------------------------------------------------------
#endif // #ifndef RDESTL_COMMON_H