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

Side by Side Diff: mojo/public/c/system/data_pipe.h

Issue 295383012: Mojo: Require our public options structs to be aligned like int64_t's. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix win 2 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « mojo/public/c/system/buffer.h ('k') | mojo/public/c/system/macros.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/constants and functions specific to data pipes. 5 // This file contains types/constants and functions specific to data pipes.
6 // 6 //
7 // Note: This header should be compilable as C. 7 // Note: This header should be compilable as C.
8 8
9 #ifndef MOJO_PUBLIC_C_SYSTEM_DATA_PIPE_H_ 9 #ifndef MOJO_PUBLIC_C_SYSTEM_DATA_PIPE_H_
10 #define MOJO_PUBLIC_C_SYSTEM_DATA_PIPE_H_ 10 #define MOJO_PUBLIC_C_SYSTEM_DATA_PIPE_H_
(...skipping 28 matching lines...) Expand all
39 MOJO_CREATE_DATA_PIPE_OPTIONS_FLAG_NONE = 0; 39 MOJO_CREATE_DATA_PIPE_OPTIONS_FLAG_NONE = 0;
40 const MojoCreateDataPipeOptionsFlags 40 const MojoCreateDataPipeOptionsFlags
41 MOJO_CREATE_DATA_PIPE_OPTIONS_FLAG_MAY_DISCARD = 1 << 0; 41 MOJO_CREATE_DATA_PIPE_OPTIONS_FLAG_MAY_DISCARD = 1 << 0;
42 #else 42 #else
43 #define MOJO_CREATE_DATA_PIPE_OPTIONS_FLAG_NONE \ 43 #define MOJO_CREATE_DATA_PIPE_OPTIONS_FLAG_NONE \
44 ((MojoCreateDataPipeOptionsFlags) 0) 44 ((MojoCreateDataPipeOptionsFlags) 0)
45 #define MOJO_CREATE_DATA_PIPE_OPTIONS_FLAG_MAY_DISCARD \ 45 #define MOJO_CREATE_DATA_PIPE_OPTIONS_FLAG_MAY_DISCARD \
46 ((MojoCreateDataPipeOptionsFlags) 1 << 0) 46 ((MojoCreateDataPipeOptionsFlags) 1 << 0)
47 #endif 47 #endif
48 48
49 struct MojoCreateDataPipeOptions { 49 MOJO_COMPILE_ASSERT(MOJO_ALIGNOF(int64_t) == 8, int64_t_has_weird_alignment);
50 struct MOJO_ALIGNAS(8) MojoCreateDataPipeOptions {
50 uint32_t struct_size; 51 uint32_t struct_size;
51 MojoCreateDataPipeOptionsFlags flags; 52 MojoCreateDataPipeOptionsFlags flags;
52 uint32_t element_num_bytes; 53 uint32_t element_num_bytes;
53 uint32_t capacity_num_bytes; 54 uint32_t capacity_num_bytes;
54 }; 55 };
55 MOJO_COMPILE_ASSERT(sizeof(MojoCreateDataPipeOptions) == 16, 56 MOJO_COMPILE_ASSERT(sizeof(MojoCreateDataPipeOptions) == 16,
56 MojoCreateDataPipeOptions_has_wrong_size); 57 MojoCreateDataPipeOptions_has_wrong_size);
57 58
58 // |MojoWriteDataFlags|: Used to specify different modes to |MojoWriteData()| 59 // |MojoWriteDataFlags|: Used to specify different modes to |MojoWriteData()|
59 // and |MojoBeginWriteData()|. 60 // and |MojoBeginWriteData()|.
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
356 // |MojoEndReadData()| has already been called). 357 // |MojoEndReadData()| has already been called).
357 MOJO_SYSTEM_EXPORT MojoResult MojoEndReadData( 358 MOJO_SYSTEM_EXPORT MojoResult MojoEndReadData(
358 MojoHandle data_pipe_consumer_handle, 359 MojoHandle data_pipe_consumer_handle,
359 uint32_t num_bytes_read); 360 uint32_t num_bytes_read);
360 361
361 #ifdef __cplusplus 362 #ifdef __cplusplus
362 } // extern "C" 363 } // extern "C"
363 #endif 364 #endif
364 365
365 #endif // MOJO_PUBLIC_C_SYSTEM_DATA_PIPE_H_ 366 #endif // MOJO_PUBLIC_C_SYSTEM_DATA_PIPE_H_
OLDNEW
« no previous file with comments | « mojo/public/c/system/buffer.h ('k') | mojo/public/c/system/macros.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698