| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #include <stdio.h> | 5 #include <stdio.h> |
| 6 | 6 |
| 7 #include "mojo/public/system/core.h" | 7 #include "mojo/public/system/core.h" |
| 8 #include "mojo/public/system/macros.h" | 8 #include "mojo/public/system/macros.h" |
| 9 #include "mojo/system/core_impl.h" | |
| 10 | 9 |
| 11 #if defined(OS_WIN) | 10 #if defined(WIN32) |
| 12 #if !defined(CDECL) | 11 #if !defined(CDECL) |
| 13 #define CDECL __cdecl | 12 #define CDECL __cdecl |
| 14 #endif | 13 #endif |
| 15 #define SAMPLE_APP_EXPORT __declspec(dllexport) | 14 #define SAMPLE_APP_EXPORT __declspec(dllexport) |
| 16 #else | 15 #else |
| 17 #define CDECL | 16 #define CDECL |
| 18 #define SAMPLE_APP_EXPORT __attribute__((visibility("default"))) | 17 #define SAMPLE_APP_EXPORT __attribute__((visibility("default"))) |
| 19 #endif | 18 #endif |
| 20 | 19 |
| 21 char* ReadStringFromPipe(mojo::Handle pipe) { | 20 char* ReadStringFromPipe(mojo::Handle pipe) { |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 mojo::Handle pipe_; | 66 mojo::Handle pipe_; |
| 68 | 67 |
| 69 MOJO_DISALLOW_COPY_AND_ASSIGN(SampleMessageWaiter); | 68 MOJO_DISALLOW_COPY_AND_ASSIGN(SampleMessageWaiter); |
| 70 }; | 69 }; |
| 71 | 70 |
| 72 extern "C" SAMPLE_APP_EXPORT MojoResult CDECL MojoMain( | 71 extern "C" SAMPLE_APP_EXPORT MojoResult CDECL MojoMain( |
| 73 mojo::Handle pipe) { | 72 mojo::Handle pipe) { |
| 74 SampleMessageWaiter(pipe).WaitAndRead(); | 73 SampleMessageWaiter(pipe).WaitAndRead(); |
| 75 return MOJO_RESULT_OK; | 74 return MOJO_RESULT_OK; |
| 76 } | 75 } |
| OLD | NEW |