Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(22)

Unified Diff: mojo/public/c/system/types.h

Issue 325213004: Mojo: Wrap the satisfied/unsatisfied wait flags state in a single object. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/mojo.gyp ('k') | mojo/system/data_pipe.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/c/system/types.h
diff --git a/mojo/public/c/system/types.h b/mojo/public/c/system/types.h
index da4577a60c1f4624341f084357a9473e19b39c32..655e302043417d2178bf424f2cd9299a86c6338f 100644
--- a/mojo/public/c/system/types.h
+++ b/mojo/public/c/system/types.h
@@ -12,6 +12,8 @@
#include <stdint.h>
+#include "mojo/public/c/system/macros.h"
+
// TODO(vtl): Notes: Use of undefined flags will lead to undefined behavior
// (typically they'll be ignored), not necessarily an error.
@@ -162,4 +164,15 @@ const MojoWaitFlags MOJO_WAIT_FLAG_EVERYTHING = ~0;
#define MOJO_WAIT_FLAG_EVERYTHING (~((MojoWaitFlags) 0))
#endif
+// TODO(vtl): Add out parameters with this to MojoWait/MojoWaitMany.
+// Note: This struct is not extensible (and only has 32-bit quantities), so it's
+// 32-bit-aligned.
+MOJO_COMPILE_ASSERT(MOJO_ALIGNOF(int32_t) == 4, int32_t_has_weird_alignment);
+struct MOJO_ALIGNAS(4) MojoWaitFlagsState {
+ MojoWaitFlags satisfied_flags;
+ MojoWaitFlags satisfiable_flags;
+};
+MOJO_COMPILE_ASSERT(sizeof(MojoWaitFlagsState) == 8,
+ MojoWaitFlagsState_has_wrong_size);
+
#endif // MOJO_PUBLIC_C_SYSTEM_TYPES_H_
« no previous file with comments | « mojo/mojo.gyp ('k') | mojo/system/data_pipe.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698