@@ -150,7 +150,41 @@ namespace modern_win32 {
150
150
synchronize = SYNCHRONIZE,
151
151
};
152
152
153
- _BITMASK_OPS (process_access_rights);
153
+ // formally _BITMASK_OPS(process_access_rights) but the definition of the macro changed without any obvious
154
+ // flag to control which version is used.
155
+
156
+ MODERN_WIN32_EXPORT [[nodiscard]] constexpr process_access_rights operator &(
157
+ process_access_rights left, process_access_rights right) noexcept {
158
+ using integer_type = std::underlying_type_t <process_access_rights>;
159
+ return static_cast <process_access_rights>(static_cast <integer_type>(left) & static_cast <integer_type>(right));
160
+ }
161
+
162
+ MODERN_WIN32_EXPORT [[nodiscard]] constexpr process_access_rights operator |(process_access_rights left, process_access_rights right) noexcept {
163
+ using integer_type = std::underlying_type_t <process_access_rights>;
164
+ return static_cast <process_access_rights>(static_cast <integer_type>(left) | static_cast <integer_type>(right));
165
+ }
166
+
167
+ MODERN_WIN32_EXPORT [[nodiscard]] constexpr process_access_rights operator ^(process_access_rights left, process_access_rights right) noexcept {
168
+ using integer_type = std::underlying_type_t <process_access_rights>;
169
+ return static_cast <process_access_rights>(static_cast <integer_type>(left) ^ static_cast <integer_type>(right));
170
+ }
171
+
172
+ MODERN_WIN32_EXPORT constexpr process_access_rights& operator &=(process_access_rights& left, process_access_rights right) noexcept {
173
+ return left = left & right;
174
+ }
175
+
176
+ MODERN_WIN32_EXPORT constexpr process_access_rights& operator |=(process_access_rights& left, process_access_rights right) noexcept {
177
+ return left = left | right;
178
+ }
179
+
180
+ MODERN_WIN32_EXPORT constexpr process_access_rights& operator ^=(process_access_rights& left, process_access_rights right) noexcept {
181
+ return left = left ^ right;
182
+ }
183
+
184
+ MODERN_WIN32_EXPORT [[nodiscard]] constexpr process_access_rights operator ~(process_access_rights left) noexcept {
185
+ using integer_type = std::underlying_type_t <process_access_rights>;
186
+ return static_cast <process_access_rights>(~static_cast <integer_type>(left));
187
+ }
154
188
155
189
// / <summary>
156
190
// / https://docs.microsoft.com/en-us/windows/win32/procthread/process-creation-flags
0 commit comments