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 #ifdef __cplusplus | 5 #ifdef __cplusplus |
6 #error "This file should be compiled as C, not C++." | 6 #error "This file should be compiled as C, not C++." |
7 #endif | 7 #endif |
8 | 8 |
| 9 // Include all the header files that are meant to be compilable as C. |
| 10 #include <mojo/macros.h> |
9 #include <stddef.h> | 11 #include <stddef.h> |
10 #include <string.h> | 12 #include <string.h> |
11 | 13 |
12 // Include all the header files that are meant to be compilable as C. | 14 // Include all the header files that are meant to be compilable as C. |
13 #include "mojo/public/c/environment/async_waiter.h" | 15 #include "mojo/public/c/environment/async_waiter.h" |
14 #include "mojo/public/c/environment/logger.h" | 16 #include "mojo/public/c/environment/logger.h" |
15 #include "mojo/public/c/system/buffer.h" | 17 #include "mojo/public/c/system/buffer.h" |
16 #include "mojo/public/c/system/data_pipe.h" | 18 #include "mojo/public/c/system/data_pipe.h" |
17 #include "mojo/public/c/system/handle.h" | 19 #include "mojo/public/c/system/handle.h" |
18 #include "mojo/public/c/system/macros.h" | |
19 #include "mojo/public/c/system/main.h" | 20 #include "mojo/public/c/system/main.h" |
20 #include "mojo/public/c/system/message_pipe.h" | 21 #include "mojo/public/c/system/message_pipe.h" |
21 #include "mojo/public/c/system/result.h" | 22 #include "mojo/public/c/system/result.h" |
22 #include "mojo/public/c/system/time.h" | 23 #include "mojo/public/c/system/time.h" |
23 #include "mojo/public/c/system/wait.h" | 24 #include "mojo/public/c/system/wait.h" |
24 #include "mojo/public/c/system/wait_set.h" | 25 #include "mojo/public/c/system/wait_set.h" |
25 | 26 |
26 // The joys of the C preprocessor.... | 27 // The joys of the C preprocessor.... |
27 #define STRINGIFY(x) #x | 28 #define STRINGIFY(x) #x |
28 #define STRINGIFY2(x) STRINGIFY(x) | 29 #define STRINGIFY2(x) STRINGIFY(x) |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 EXPECT_EQ((uint32_t)sizeof(kHello), num_bytes); | 103 EXPECT_EQ((uint32_t)sizeof(kHello), num_bytes); |
103 EXPECT_EQ(0, memcmp(buffer, kHello, sizeof(kHello))); | 104 EXPECT_EQ(0, memcmp(buffer, kHello, sizeof(kHello))); |
104 | 105 |
105 EXPECT_EQ(MOJO_RESULT_OK, MojoClose(handle0)); | 106 EXPECT_EQ(MOJO_RESULT_OK, MojoClose(handle0)); |
106 EXPECT_EQ(MOJO_RESULT_OK, MojoClose(handle1)); | 107 EXPECT_EQ(MOJO_RESULT_OK, MojoClose(handle1)); |
107 | 108 |
108 // TODO(vtl): data pipe | 109 // TODO(vtl): data pipe |
109 | 110 |
110 return NULL; | 111 return NULL; |
111 } | 112 } |
OLD | NEW |