-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrdestl_common.h
69 lines (62 loc) · 1.39 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
#ifndef RDESTL_COMMON_H
#define RDESTL_COMMON_H
#ifndef RDESTL_STANDALONE
# define RDESTL_STANDALONE 1
#endif
#if RDESTL_STANDALONE
# ifdef _MSC_VER
# 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
namespace rde
{
// # Meh. MSVC doesnt seem to have <stdint.h>
// @todo Fixes to make this portable.
typedef unsigned char uint8;
typedef unsigned short uint16;
typedef signed long int32;
typedef unsigned long uint32;
#ifdef _MSC_VER
typedef unsigned __int64 uint64;
#else
typedef unsigned long long uint64;
#endif
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);
}
} // sys
}
#else
# include "core/RdeAssert.h"
# include "core/System.h"
#endif
namespace rde
{
enum e_noinitialize
{
noinitialize
};
}
#endif // #ifndef RDESTL_H