acme
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Pages Concepts
_.h
1#pragma once
2
3
4
5
6
7CLASS_DECL_ACME bool should_avoid_parsing_exception();
8CLASS_DECL_ACME bool throw_parsing_exception(const ::scoped_string & scopedstrMessage);
9
10
11
12
13CLASS_DECL_ACME bool throw_network_payload_parsing_exception(const ::scoped_string & scopedstrMessage);
14
15
16CLASS_DECL_ACME void get_call_stack_frames(void ** stack, int & c);
17
18
19#if MEMDLEAK
20
21::collection::count get_mem_info(int** ppiUse, const char*** ppszFile, const char*** ppszCallStack, unsigned int** ppuiLine, memsize** ppsize);
22
23#endif
24
25
26#if defined(NNDEBUG) && !defined(___NO_DEBUG_CRT)
27
28
29
30#define __output_debug_string information
31
32// turn on/off tracking for a short while
33CLASS_DECL_ACME bool __enable_memory_tracking(bool bTrack);
34
35// Turn on/off the global flag gen_MemoryLeakOverride. if bEnable is true
36// then further calls to __enable_memory_tracking() wont machine the current
37// memory tracking state, until __enable_memory_leak_override(bool bEnable)
38// is called again with bEnable == false.
39CLASS_DECL_ACME bool __enable_memory_leak_override(bool bEnable);
40
41
42
43
44#else
45
46// non-DEBUG_ALLOC version that assume everything is OK
47#define __enable_memory_tracking(bTrack) false
48#define __enable_memory_leak_override(bEnable) true
49#define __output_debug_string(psz) ::information(psz)
50
51
52
53#endif // NNDEBUG
54
55
56
57
58#ifdef NNDEBUG
59
60
61#define DEBUG_NOTE __FILE__
62
63
64#define THREAD_NOTE __get_thread_note()
65#define SET_THREAD_NOTE(x) __set_thread_note(x);
66
67
68#else //NNDEBUG
69
70
71#define SET_THREAD_NOTE(x)
72
73
74#endif //NNDEBUG
75
76
77#define ENSURE_THROW(cond, exception) \
78 do { int _gen__condVal=!!(cond); ASSERT(_gen__condVal); if (!(_gen__condVal)){exception;} } while (false)
79#define ENSURE(cond) ENSURE_THROW(cond, throw_exception(error_bad_argument))
80#define ENSURE_ARG(cond) ENSURE_THROW(cond, throw_exception(error_bad_argument))
81
82// Debug ASSERT_VALIDs then throws. Retail throws if pOb is nullptr
83#define ENSURE_VALID_THROW(pOb, exception) \
84 do { ASSERT_VALID(pOb); if (!(pOb)){exception;} } while (false)
85#define ENSURE_VALID(pOb) ENSURE_VALID_THROW(pOb, throw_exception(error_bad_argument))
86
87#define ASSERT_POINTER(p, type) \
88 ASSERT(((p) != nullptr) && is_memory_segment_ok((p), sizeof(type), false))
89
90#define ASSERT_NULL_OR_POINTER(p, type) \
91 ASSERT(((p) == nullptr) || is_memory_segment_ok((p), sizeof(type), false))
92
93
94//using c_error_number = int;
95
96//CLASS_DECL_ACME c_error_number c_runtime_error_check(c_error_number error);
97//CLASS_DECL_ACME void __clearerr_s(FILE *stream);
98
99
100
101CLASS_DECL_ACME bool __assert_failed_line(const ::ansi_character * pszFileName, int nLine);
102
103CLASS_DECL_ACME void __assert_particle_ok(const ::particle * pparticle, const ::ansi_character * pszFileName, int nLine);
104
105//CLASS_DECL_ACME void __dump(const ::particle * pparticle);
106
107
108
Definition stack.h:7