OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // This file contains types and constants/macros common to different Mojo system | 5 // This file contains types and constants/macros common to different Mojo system |
6 // APIs. | 6 // APIs. |
7 // | 7 // |
8 // Note: This header should be compilable as C. | 8 // Note: This header should be compilable as C. |
9 | 9 |
10 #ifndef MOJO_PUBLIC_C_SYSTEM_TYPES_H_ | 10 #ifndef MOJO_PUBLIC_C_SYSTEM_TYPES_H_ |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 const MojoHandleSignals MOJO_HANDLE_SIGNAL_WRITABLE = 1 << 1; | 158 const MojoHandleSignals MOJO_HANDLE_SIGNAL_WRITABLE = 1 << 1; |
159 #else | 159 #else |
160 #define MOJO_HANDLE_SIGNAL_NONE ((MojoHandleSignals) 0) | 160 #define MOJO_HANDLE_SIGNAL_NONE ((MojoHandleSignals) 0) |
161 #define MOJO_HANDLE_SIGNAL_READABLE ((MojoHandleSignals) 1 << 0) | 161 #define MOJO_HANDLE_SIGNAL_READABLE ((MojoHandleSignals) 1 << 0) |
162 #define MOJO_HANDLE_SIGNAL_WRITABLE ((MojoHandleSignals) 1 << 1) | 162 #define MOJO_HANDLE_SIGNAL_WRITABLE ((MojoHandleSignals) 1 << 1) |
163 #endif | 163 #endif |
164 | 164 |
165 // TODO(vtl): Add out parameters with this to MojoWait/MojoWaitMany. | 165 // TODO(vtl): Add out parameters with this to MojoWait/MojoWaitMany. |
166 // Note: This struct is not extensible (and only has 32-bit quantities), so it's | 166 // Note: This struct is not extensible (and only has 32-bit quantities), so it's |
167 // 32-bit-aligned. | 167 // 32-bit-aligned. |
168 // TODO(vtl): Rename this to MojoHandleSignalsState. | |
169 MOJO_COMPILE_ASSERT(MOJO_ALIGNOF(int32_t) == 4, int32_t_has_weird_alignment); | 168 MOJO_COMPILE_ASSERT(MOJO_ALIGNOF(int32_t) == 4, int32_t_has_weird_alignment); |
170 struct MOJO_ALIGNAS(4) MojoWaitFlagsState { | 169 struct MOJO_ALIGNAS(4) MojoHandleSignalsState { |
171 MojoHandleSignals satisfied_signals; | 170 MojoHandleSignals satisfied_signals; |
172 MojoHandleSignals satisfiable_signals; | 171 MojoHandleSignals satisfiable_signals; |
173 }; | 172 }; |
174 MOJO_COMPILE_ASSERT(sizeof(MojoWaitFlagsState) == 8, | 173 MOJO_COMPILE_ASSERT(sizeof(MojoHandleSignalsState) == 8, |
175 MojoWaitFlagsState_has_wrong_size); | 174 MojoHandleSignalsState_has_wrong_size); |
176 | 175 |
177 #endif // MOJO_PUBLIC_C_SYSTEM_TYPES_H_ | 176 #endif // MOJO_PUBLIC_C_SYSTEM_TYPES_H_ |
OLD | NEW |