Skip to content

Commit c8bd8cd

Browse files
authored
Switch to CMake build, new logging implementation (#17)
* Switch to CMake * Logging to Windows event log * ClassFactory now supports COM aggregation * C++20 * Improved formatters (wchar_t, formatting of COM, PropVariant/VARIANT objects and string-like objects) * Replaced most logging and exception macros with template code * Unity build
1 parent 3879471 commit c8bd8cd

File tree

131 files changed

+19416
-7735
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

131 files changed

+19416
-7735
lines changed

.clang-format

+22-9
Original file line numberDiff line numberDiff line change
@@ -5,29 +5,42 @@ AllowShortFunctionsOnASingleLine: None
55
AllowShortIfStatementsOnASingleLine: false
66
AllowShortLoopsOnASingleLine: false
77
BreakBeforeBinaryOperators: NonAssignment
8+
BreakBeforeConceptDeclarations: true
89
BreakConstructorInitializers: BeforeComma
910
BreakInheritanceList: BeforeComma
1011
ColumnLimit: 0
12+
DerivePointerAlignment: false
1113
IncludeBlocks: Regroup
1214
IncludeCategories:
13-
- Regex: '^"m3c/.*\.h"'
15+
- Regex: '^"m3c/.*\.h"$'
1416
Priority: 2
15-
- Regex: '^<m3c/.*\.h>'
17+
- Regex: '^<m3c/.*\.h>$'
1618
Priority: 2
17-
- Regex: '^<[[:alnum:]]+/.*\.h[hpx]{0,2}>'
19+
- Regex: '^<m4t/.*\.h>$'
1820
Priority: 3
19-
- Regex: '^<.*\.h[hpx]{0,2}>'
20-
Priority: 4
21-
- Regex: '^<.*>'
21+
- Regex: '^<[[:alnum:]]+/.*\.h[hpx]{0,2}>$'
2222
Priority: 5
23+
- Regex: '^<windows.h>$'
24+
Priority: 6
25+
SortPriority: 6
26+
- Regex: '^<.*\.h[hpx]{0,2}>$'
27+
Priority: 6
28+
SortPriority: 7
29+
- Regex: '^<.*>$'
30+
Priority: 8
31+
- Regex: '^".*\.events\.h"$'
32+
Priority: 4
2333
- Regex: '.*'
2434
Priority: 1
25-
IncludeIsMainRegex: '(_Test)?$'
35+
IncludeIsMainRegex: '(\.test\.)?$'
2636
IndentCaseLabels: false
37+
IndentRequires: false
2738
IndentWidth: 4
2839
MaxEmptyLinesToKeep: 2
40+
PointerAlignment: Left
41+
ShortNamespaceLines: 0
2942
SpaceAfterCStyleCast: true
3043
SpacesBeforeTrailingComments: 2
31-
Standard: Cpp11
44+
Standard: c++20
3245
TabWidth: 4
33-
UseTab: ForContinuationAndIndentation
46+
UseTab: ForIndentation

.clang-tidy

+143-119
Original file line numberDiff line numberDiff line change
@@ -1,173 +1,197 @@
1-
Checks: '
1+
Checks: '-*,
22
bugprone-*,
3-
cert-*,
3+
-bugprone-bad-signal-to-kill-thread,
4+
-bugprone-no-escape,
5+
-bugprone-posix-return,
6+
-bugprone-signal-handler,
7+
cert-non-aliased-only-*,
8+
cert-dcl21-cpp,
9+
cert-dcl50-cpp,
10+
cert-dcl58-cpp,
11+
-cert-env33-c,
12+
cert-err34-c,
13+
cert-err52-cpp,
14+
cert-err58-cpp,
15+
cert-err60-cpp,
16+
-cert-exp42-c,
17+
cert-flp30-c,
18+
-cert-flp37-c,
19+
cert-mem57-cpp,
20+
cert-msc50-cpp,
21+
cert-msc51-cpp,
22+
cert-oop57-cpp,
23+
cert-oop58-cpp,
424
clang-analyzer-*,
525
clang-diagnostic-*,
626
-clang-diagnostic-gnu-zero-variadic-macro-arguments,
727
-clang-diagnostic-language-extension-token,
8-
cppcoreguidelines-*,
9-
-cppcoreguidelines-avoid-c-arrays,
28+
concurrency-*,
29+
-concurrency-thread-canceltype-asynchronous,
30+
cppcoreguidelines-non-aliased-only-*,
31+
cppcoreguidelines-avoid-goto,
32+
cppcoreguidelines-avoid-non-const-global-variables,
33+
cppcoreguidelines-init-variables,
34+
cppcoreguidelines-interfaces-global-init,
35+
-cppcoreguidelines-macro-usage,
36+
cppcoreguidelines-narrowing-conversions,
37+
cppcoreguidelines-no-malloc,
1038
-cppcoreguidelines-owning-memory,
11-
-cppcoreguidelines-pro-type-reinterpret-cast,
12-
-cppcoreguidelines-pro-type-union-access,
39+
cppcoreguidelines-prefer-member-initializer,
1340
-cppcoreguidelines-pro-bounds-*,
14-
google-*,
15-
-google-readability-*,
16-
-google-runtime-*,
17-
hicpp-avoid-goto,
18-
hicpp-exception-baseclass,
19-
hicpp-multiway-paths-covered,
20-
-hicpp-no-assembler,
21-
hicpp-signed-bitwise,
22-
llvm-*,
23-
-llvm-header-guard,
24-
-llvm-qualified-auto,
41+
-cppcoreguidelines-pro-type-*,
42+
cppcoreguidelines-pro-type-const-cast,
43+
cppcoreguidelines-pro-type-cstyle-cast,
44+
cppcoreguidelines-pro-type-member-init,
45+
cppcoreguidelines-pro-type-static-cast-downcast,
46+
cppcoreguidelines-pro-type-vararg,
47+
cppcoreguidelines-slicing,
48+
cppcoreguidelines-special-member-functions,
49+
cppcoreguidelines-virtual-class-destructor,
50+
google-non-aliased-only-*,
51+
google-build-explicit-make-pair,
52+
google-build-namespaces,
53+
google-build-using-namespace,
54+
google-default-arguments,
55+
google-explicit-constructor,
56+
google-global-names-in-headers,
57+
google-upgrade-googletest-case,
58+
hicpp-non-aliased-only-*,
59+
hicpp-exception-baseclass,
60+
hicpp-multiway-paths-covered,
61+
hicpp-signed-bitwise,
62+
llvm-namespace-comment,
2563
misc-*,
64+
-misc-misplaced-const,
65+
-misc-no-recursion,
2666
modernize-*,
2767
-modernize-avoid-c-arrays,
68+
-modernize-return-braced-init-list,
2869
-modernize-use-auto,
2970
-modernize-use-trailing-return-type,
3071
performance-*,
3172
readability-*,
73+
-readability-function-cognitive-complexity,
3274
-readability-function-size,
33-
-readability-qualified-auto,
75+
-readability-identifier-length,
3476
-readability-redundant-access-specifiers'
3577
WarningsAsErrors: ''
36-
HeaderFilterRegex: 'm3c[\/\\](src|include)[\/\\].*'
78+
HeaderFilterRegex: '.*'
3779
ExtraArgsBefore: [
38-
'--system-header-prefix=lib/', '-xc++', '-std=c++20',
39-
'-WCL4', '-Wpedantic', '-Wthread-safety', '-Wmicrosoft', '-Wdocumentation', '-Wdocumentation-pedantic', '-Wtautological-compare',
4080
'-fms-extensions', '-fms-compatibility', '-D_CRT_USE_BUILTIN_OFFSETOF',
41-
'-fno-delayed-template-parsing', '-fcomment-block-commands=internal,hideinitializer',
42-
'-Im3c/include', '-Ilib/fmt/include', '-Ilib/llamalog/include',
43-
'-DUNICODE', '-D_UNICODE', '-DNOMINMAX', '-DWIN32_LEAN_AND_MEAN'
81+
'-WCL4', '-Wpedantic', '-Wthread-safety', '-Wmicrosoft', '-Wdocumentation', '-Wdocumentation-pedantic',
82+
'-fno-delayed-template-parsing', '/clang:-fcomment-block-commands=internal,hideinitializer',
83+
'-DWIN32_LEAN_AND_MEAN=1', '-DNOMINMAX=1'
4484
]
4585
CheckOptions:
86+
- key: bugprone-argument-comment.StrictMode
87+
value: 1
4688
- key: bugprone-assert-side-effect.AssertMacros
4789
value: 'assert,_assert,_wassert,_ASSERT,_ASSERTE,_ASSERT_EXPR'
4890
- key: bugprone-assert-side-effect.CheckFunctionCalls
49-
value: '1'
91+
value: 1
92+
- key: bugprone-sizeof-expression.WarnOnSizeOfIntegerExpression
93+
value: 1
5094
- key: bugprone-suspicious-enum-usage.StrictMode
51-
value: '1'
95+
value: 1
96+
- key: bugprone-suspicious-string-compare.WarnOnLogicalNotComparison
97+
value: 1
5298
- key: cppcoreguidelines-narrowing-conversions.PedanticMode
53-
value: '1'
99+
value: 1
54100
- key: hicpp-multiway-paths-covered.WarnOnMissingElse
55-
value: '1'
101+
value: 1
56102
- key: hicpp-signed-bitwise.IgnorePositiveIntegerLiterals
57-
value: '1'
103+
value: 1
104+
- key: misc-throw-by-value-catch-by-reference.CheckThrowTemporaries
105+
value: 0
58106
- key: misc-unused-parameters.StrictMode
59-
value: '1'
60-
- key: modernize-use-override.IgnoreDestructors
61-
value: '1'
107+
value: 1
62108
- key: performance-inefficient-string-concatenation.StrictMode
63-
value: '1'
64-
- key: readability-braces-around-statements.ShortStatementLines
65-
value: '0'
109+
value: 1
110+
111+
- key: readability-identifier-naming.NamespaceCase
112+
value: lower_case
113+
114+
- key: readability-identifier-naming.FunctionCase
115+
value: aNy_CasE
116+
117+
- key: readability-identifier-naming.VariableCase
118+
value: camelBack
119+
- key: readability-identifier-naming.StaticVariableCase
120+
value: camelBack
121+
122+
- key: readability-identifier-naming.StaticConstantCase
123+
value: CamelCase
124+
- key: readability-identifier-naming.StaticConstantPrefix
125+
value: 'k'
126+
- key: readability-identifier-naming.ConstexprVariableCase
127+
value: CamelCase
128+
- key: readability-identifier-naming.ConstexprVariablePrefix
129+
value: 'k'
130+
- key: readability-identifier-naming.ConstexprVariableIgnoredRegexp
131+
value: '^is_[A-Za-z0-9_]+_v$'
132+
- key: readability-identifier-naming.GlobalConstantCase
133+
value: CamelCase
134+
- key: readability-identifier-naming.GlobalConstantPrefix
135+
value: 'k'
136+
66137
- key: readability-identifier-naming.ClassCase
67-
value: 'lower_case'
138+
value: aNy_CasE
68139
- key: readability-identifier-naming.StructCase
69-
value: 'lower_case'
140+
value: aNy_CasE
70141
- key: readability-identifier-naming.UnionCase
71-
value: 'lower_case'
142+
value: aNy_CasE
143+
- key: readability-identifier-naming.EnumCase
144+
value: CamelCase
145+
- key: readability-identifier-naming.EnumConstantCase
146+
value: CamelCase
147+
- key: readability-identifier-naming.EnumConstantPrefix
148+
value: 'k'
149+
- key: readability-identifier-naming.ScopedEnumConstantCase
150+
value: CamelCase
151+
- key: readability-identifier-naming.ScopedEnumConstantPrefix
152+
value: 'k'
72153
- key: readability-identifier-naming.TypeAliasCase
73-
value: 'lower_case'
154+
value: aNy_CasE
74155
- key: readability-identifier-naming.TypedefCase
75-
value: 'lower_case'
156+
value: aNy_CasE
157+
76158
- key: readability-identifier-naming.MemberCase
77-
value: 'camelBack'
159+
value: camelBack
78160
- key: readability-identifier-naming.MemberPrefix
79161
value: 'm_'
80-
- key: readability-identifier-naming.ConstantMemberCase
81-
value: 'camelBack'
82-
- key: readability-identifier-naming.ConstantMemberPrefix
83-
value: 'm_'
84162
- key: readability-identifier-naming.PublicMemberCase
85-
value: 'camelBack'
163+
value: camelBack
86164
- key: readability-identifier-naming.PublicMemberPrefix
87165
value: ''
88166
- key: readability-identifier-naming.ClassMemberCase
89-
value: 'camelBack'
167+
value: camelBack
90168
- key: readability-identifier-naming.ClassMemberPrefix
91-
value: 'm_'
92-
- key: readability-identifier-naming.ClassConstantCase
93-
value: 'CamelCase'
94-
- key: readability-identifier-naming.ClassConstantPrefix
95-
value: 'k'
96-
- key: readability-identifier-naming.EnumCase
97-
value: 'lower_case'
98-
- key: readability-identifier-naming.EnumConstantCase
99-
value: 'CamelCase'
100-
- key: readability-identifier-naming.EnumConstantPrefix
101-
value: 'k'
102-
- key: readability-identifier-naming.FunctionCase
103-
value: 'lower_case'
104-
- key: readability-identifier-naming.NamespaceCase
105-
value: 'lower_case'
106-
- key: readability-identifier-naming.VariableCase
107-
value: 'camelBack'
108-
- key: readability-identifier-naming.VariablePrefix
109-
value: ''
110-
- key: readability-identifier-naming.ConstantCase
111-
value: 'CamelCase'
112-
- key: readability-identifier-naming.ConstantPrefix
113-
value: 'k'
114-
- key: readability-identifier-naming.LocalVariableCase
115-
value: 'camelBack'
116-
- key: readability-identifier-naming.LocalVariablePrefix
117-
value: ''
118-
- key: readability-identifier-naming.LocalConstantCase
119-
value: 'camelBack'
120-
- key: readability-identifier-naming.LocalConstantPrefix
121-
value: ''
122-
- key: readability-identifier-naming.ParameterCase
123-
value: 'camelBack'
124-
- key: readability-identifier-naming.ParameterPrefix
125-
value: ''
126-
- key: readability-identifier-naming.ConstantParameterCase
127-
value: 'camelBack'
128-
- key: readability-identifier-naming.ConstantParameterPrefix
129-
value: ''
130-
- key: readability-identifier-naming.GlobalVariableCase
131-
value: 'camelBack'
132-
- key: readability-identifier-naming.GlobalVariablePrefix
133-
value: 'g_'
134-
- key: readability-identifier-naming.GlobalConstantCase
135-
value: 'CamelCase'
136-
- key: readability-identifier-naming.GlobalConstantPrefix
137-
value: 'k'
138-
- key: readability-identifier-naming.StaticVariableCase
139-
value: 'camelBack'
140-
- key: readability-identifier-naming.StaticVariablePrefix
141-
value: ''
142-
- key: readability-identifier-naming.StaticConstantCase
143-
value: 'CamelCase'
144-
- key: readability-identifier-naming.StaticConstantPrefix
145-
value: 'k'
146-
- key: readability-identifier-naming.GlobalPointerCase
147-
value: 'CamelCase'
148-
- key: readability-identifier-naming.GlobalPointerPrefix
149-
value: 'g_p'
150-
- key: readability-identifier-naming.GlobalConstantPointerCase
151-
value: 'CamelCase'
152-
- key: readability-identifier-naming.GlobalConstantPointerPrefix
153-
value: 'kp'
169+
value: 's_'
170+
154171
- key: readability-identifier-naming.TemplateParameterCase
155-
value: 'CamelCase'
172+
value: CamelCase
156173
- key: readability-identifier-naming.ValueTemplateParameterCase
157-
value: 'CamelCase'
174+
value: CamelCase
158175
- key: readability-identifier-naming.ValueTemplateParameterPrefix
159176
value: 'k'
160177
- key: readability-identifier-naming.ParameterPackCase
161-
value: 'camelBack'
178+
value: camelBack
179+
- key: readability-identifier-naming.ParameterPackSuffix
180+
value: 's'
181+
- key: readability-identifier-naming.MacroDefinitionCase
182+
value: 'UPPER_CASE'
183+
162184
- key: readability-implicit-bool-conversion.AllowIntegerConditions
163-
value: '1'
185+
value: 1
164186
- key: readability-implicit-bool-conversion.AllowPointerConditions
165-
value: '1'
187+
value: 1
166188
- key: readability-inconsistent-declaration-parameter-name.Strict
167-
value: '1'
189+
value: 1
190+
- key: readability-magic-numbers.IgnorePowersOf2IntegerValues
191+
value: 1
168192
- key: readability-simplify-boolean-expr.ChainedConditionalReturn
169-
value: '1'
193+
value: 1
170194
- key: readability-simplify-boolean-expr.ChainedConditionalAssignment
171-
value: '1'
195+
value: 1
172196
- key: readability-uppercase-literal-suffix.NewSuffixes
173-
value: 'L;LL;LU;LLU;u;ul;ull'
197+
value: 'L;LL;u;uL;uLL'

.editorconfig

+10-3
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,23 @@ guidelines=80
1111
[*.{cpp,h}]
1212
guidelines=80,120
1313

14+
[{*.cmake,CMakeLists.txt}]
15+
indent_style=space
16+
guidelines=80,120
17+
18+
[*.json]
19+
indent_style=space
20+
tab_width=2
21+
1422
[*.md]
1523
indent_style=space
1624
tab_width=2
1725
trim_trailing_whitespace=false
1826
guidelines=120
1927

20-
[*.yml]
21-
indent_style=space
28+
[*.{xml,man}]
2229
tab_width=2
2330

24-
[{.clang-format, .clang-tidy}]
31+
[{*.yml,.clang-format,.clang-tidy}]
2532
indent_style=space
2633
tab_width=2

0 commit comments

Comments
 (0)