| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "mojo/platform_handle/platform_handle_private_thunks.h" | 5 #include "mojo/platform_handle/platform_handle_private_thunks.h" |
| 6 | 6 |
| 7 #include <assert.h> | 7 #include <assert.h> |
| 8 #include <stddef.h> |
| 8 | 9 |
| 9 #if defined(WIN32) | 10 #if defined(WIN32) |
| 10 #define THUNK_EXPORT __declspec(dllexport) | 11 #define THUNK_EXPORT __declspec(dllexport) |
| 11 #else | 12 #else |
| 12 #define THUNK_EXPORT __attribute__((visibility("default"))) | 13 #define THUNK_EXPORT __attribute__((visibility("default"))) |
| 13 #endif | 14 #endif |
| 14 | 15 |
| 15 extern "C" { | 16 extern "C" { |
| 16 | 17 |
| 17 static MojoPlatformHandlePrivateThunks g_thunks = {0}; | 18 static MojoPlatformHandlePrivateThunks g_thunks = {0}; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 29 } | 30 } |
| 30 | 31 |
| 31 extern "C" THUNK_EXPORT size_t MojoSetPlatformHandlePrivateThunks( | 32 extern "C" THUNK_EXPORT size_t MojoSetPlatformHandlePrivateThunks( |
| 32 const MojoPlatformHandlePrivateThunks* thunks) { | 33 const MojoPlatformHandlePrivateThunks* thunks) { |
| 33 if (thunks->size >= sizeof(g_thunks)) | 34 if (thunks->size >= sizeof(g_thunks)) |
| 34 g_thunks = *thunks; | 35 g_thunks = *thunks; |
| 35 return sizeof(g_thunks); | 36 return sizeof(g_thunks); |
| 36 } | 37 } |
| 37 | 38 |
| 38 } // extern "C" | 39 } // extern "C" |
| OLD | NEW |