OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 The Crashpad Authors. All rights reserved. |
| 2 // |
| 3 // Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 // you may not use this file except in compliance with the License. |
| 5 // You may obtain a copy of the License at |
| 6 // |
| 7 // http://www.apache.org/licenses/LICENSE-2.0 |
| 8 // |
| 9 // Unless required by applicable law or agreed to in writing, software |
| 10 // distributed under the License is distributed on an "AS IS" BASIS, |
| 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 // See the License for the specific language governing permissions and |
| 13 // limitations under the License. |
| 14 |
| 15 #ifndef CRASHPAD_UTIL_MACH_MACH_EXTENSIONS_H_ |
| 16 #define CRASHPAD_UTIL_MACH_MACH_EXTENSIONS_H_ |
| 17 |
| 18 #include <mach/mach.h> |
| 19 |
| 20 namespace crashpad { |
| 21 |
| 22 //! \brief `MACH_PORT_NULL` with the correct type for a Mach port, |
| 23 //! `mach_port_t`. |
| 24 //! |
| 25 //! For situations where implicit conversions between signed and unsigned types |
| 26 //! are not performed, use kMachPortNull instead of an explicit `static_cast` of |
| 27 //! `MACH_PORT_NULL` to `mach_port_t`. This is useful for logging and testing |
| 28 //! assertions. |
| 29 const mach_port_t kMachPortNull = MACH_PORT_NULL; |
| 30 |
| 31 // Because exception_mask_t is an int and has one bit for each defined |
| 32 // exception_type_t, it’s reasonable to assume that there cannot be any |
| 33 // officially-defined exception_type_t values higher than 31. |
| 34 // kMachExceptionSimulated uses a value well outside this range because it does |
| 35 // not require a corresponding mask value. Simulated exceptions are delivered to |
| 36 // the exception handler registered for EXC_CRASH exceptions using |
| 37 // EXC_MASK_CRASH. |
| 38 |
| 39 //! \brief An exception type to use for simulated exceptions. |
| 40 const exception_type_t kMachExceptionSimulated = 'CPsx'; |
| 41 |
| 42 } // namespace crashpad |
| 43 |
| 44 #endif // CRASHPAD_UTIL_MACH_MACH_EXTENSIONS_H_ |
OLD | NEW |