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

Side by Side Diff: mojo/public/c/system/buffer.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: 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 | « no previous file | mojo/public/c/system/data_pipe.h » ('j') | mojo/public/c/system/macros.h » ('J')
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 buffers (and in 5 // This file contains types/constants and functions specific to buffers (and in
6 // particular shared buffers). 6 // particular shared buffers).
7 // TODO(vtl): Reorganize this file (etc.) to separate general buffer functions 7 // TODO(vtl): Reorganize this file (etc.) to separate general buffer functions
8 // from (shared) buffer creation. 8 // from (shared) buffer creation.
9 // 9 //
10 // Note: This header should be compilable as C. 10 // Note: This header should be compilable as C.
(...skipping 20 matching lines...) Expand all
31 typedef uint32_t MojoCreateSharedBufferOptionsFlags; 31 typedef uint32_t MojoCreateSharedBufferOptionsFlags;
32 32
33 #ifdef __cplusplus 33 #ifdef __cplusplus
34 const MojoCreateSharedBufferOptionsFlags 34 const MojoCreateSharedBufferOptionsFlags
35 MOJO_CREATE_SHARED_BUFFER_OPTIONS_FLAG_NONE = 0; 35 MOJO_CREATE_SHARED_BUFFER_OPTIONS_FLAG_NONE = 0;
36 #else 36 #else
37 #define MOJO_CREATE_SHARED_BUFFER_OPTIONS_FLAG_NONE \ 37 #define MOJO_CREATE_SHARED_BUFFER_OPTIONS_FLAG_NONE \
38 ((MojoCreateSharedBufferOptionsFlags) 0) 38 ((MojoCreateSharedBufferOptionsFlags) 0)
39 #endif 39 #endif
40 40
41 struct MojoCreateSharedBufferOptions { 41 struct MOJO_ALIGNAS(MOJO_ALIGNOF(int64_t)) MojoCreateSharedBufferOptions {
42 uint32_t struct_size; 42 uint32_t struct_size;
43 MojoCreateSharedBufferOptionsFlags flags; 43 MojoCreateSharedBufferOptionsFlags flags;
44 }; 44 };
45 MOJO_COMPILE_ASSERT(sizeof(MojoCreateSharedBufferOptions) == 8, 45 MOJO_COMPILE_ASSERT(sizeof(MojoCreateSharedBufferOptions) == 8,
46 MojoCreateSharedBufferOptions_has_wrong_size); 46 MojoCreateSharedBufferOptions_has_wrong_size);
47 47
48 // |MojoDuplicateBufferHandleOptions|: Used to specify parameters in duplicating 48 // |MojoDuplicateBufferHandleOptions|: Used to specify parameters in duplicating
49 // access to a shared buffer to |MojoDuplicateBufferHandle()|. 49 // access to a shared buffer to |MojoDuplicateBufferHandle()|.
50 // |uint32_t struct_size|: Set to the size of the 50 // |uint32_t struct_size|: Set to the size of the
51 // |MojoDuplicateBufferHandleOptions| struct. (Used to allow for future 51 // |MojoDuplicateBufferHandleOptions| struct. (Used to allow for future
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 132
133 // Unmap a buffer pointer that was mapped by |MojoMapBuffer()|. 133 // Unmap a buffer pointer that was mapped by |MojoMapBuffer()|.
134 // TODO(vtl): More. 134 // TODO(vtl): More.
135 MOJO_SYSTEM_EXPORT MojoResult MojoUnmapBuffer(void* buffer); // In. 135 MOJO_SYSTEM_EXPORT MojoResult MojoUnmapBuffer(void* buffer); // In.
136 136
137 #ifdef __cplusplus 137 #ifdef __cplusplus
138 } // extern "C" 138 } // extern "C"
139 #endif 139 #endif
140 140
141 #endif // MOJO_PUBLIC_C_SYSTEM_BUFFER_H_ 141 #endif // MOJO_PUBLIC_C_SYSTEM_BUFFER_H_
OLDNEW
« no previous file with comments | « no previous file | mojo/public/c/system/data_pipe.h » ('j') | mojo/public/c/system/macros.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698