forked from snakster/cpp.react
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDefs.h
More file actions
41 lines (31 loc) · 1.25 KB
/
Defs.h
File metadata and controls
41 lines (31 loc) · 1.25 KB
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
// Copyright Sebastian Jeckel 2014.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#pragma once
///////////////////////////////////////////////////////////////////////////////////////////////////
#define REACT_BEGIN namespace react {
#define REACT_END }
#define REACT ::react
#define REACT_IMPL_BEGIN REACT_BEGIN namespace impl {
#define REACT_IMPL_END REACT_END }
#define REACT_IMPL REACT ::impl
#ifdef _DEBUG
#define REACT_MESSAGE(...) printf(__VA_ARGS__ ## "\n")
#else
#define REACT_MESSAGE
#endif
// Assert with message
#define REACT_ASSERT(condition, ...) for (; !(condition); assert(condition)) printf(__VA_ARGS__ ## "\n")
#define REACT_ERROR(...) REACT_ASSERT(false, __VA_ARGS__)
// Logging
#ifdef REACT_ENABLE_LOGGING
#define REACT_LOG(...) __VA_ARGS__
#else
#define REACT_LOG(...)
#endif
/*****************************************/ REACT_BEGIN /*****************************************/
// Type aliases
using uint = unsigned int;
using uchar = unsigned char;
/******************************************/ REACT_END /******************************************/