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 #ifndef MOJO_PUBLIC_C_SYSTEM_MACROS_H_ | 5 #ifndef MOJO_PUBLIC_C_SYSTEM_MACROS_H_ |
6 #define MOJO_PUBLIC_C_SYSTEM_MACROS_H_ | 6 #define MOJO_PUBLIC_C_SYSTEM_MACROS_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 // Annotate a variable indicating it's okay if it's unused. | 10 // Annotate a variable indicating it's okay if it's unused. |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 #if __cplusplus >= 201103L | 55 #if __cplusplus >= 201103L |
56 #define MOJO_ALIGNAS(alignment) alignas(alignment) | 56 #define MOJO_ALIGNAS(alignment) alignas(alignment) |
57 #elif defined(__GNUC__) | 57 #elif defined(__GNUC__) |
58 #define MOJO_ALIGNAS(alignment) __attribute__((aligned(alignment))) | 58 #define MOJO_ALIGNAS(alignment) __attribute__((aligned(alignment))) |
59 #elif defined(_MSC_VER) | 59 #elif defined(_MSC_VER) |
60 #define MOJO_ALIGNAS(alignment) __declspec(align(alignment)) | 60 #define MOJO_ALIGNAS(alignment) __declspec(align(alignment)) |
61 #else | 61 #else |
62 #error "Please define MOJO_ALIGNAS() for your compiler." | 62 #error "Please define MOJO_ALIGNAS() for your compiler." |
63 #endif | 63 #endif |
64 | 64 |
| 65 // Use these to declare functions in C header files so that they'll be usable |
| 66 // from C++. |
| 67 #if defined(__cplusplus) |
| 68 #define MOJO_BEGIN_EXTERN_C extern "C" { |
| 69 #define MOJO_END_EXTERN_C } |
| 70 #else |
| 71 #define MOJO_BEGIN_EXTERN_C |
| 72 #define MOJO_END_EXTERN_C |
| 73 #endif |
| 74 |
65 #endif // MOJO_PUBLIC_C_SYSTEM_MACROS_H_ | 75 #endif // MOJO_PUBLIC_C_SYSTEM_MACROS_H_ |
OLD | NEW |