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

Side by Side Diff: mojo/public/c/system/macros.h

Issue 1807613002: Add MOJO_{BEGIN,END}_EXTERN_C macros, and use them. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: asdf Created 4 years, 9 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
« no previous file with comments | « mojo/public/c/system/handle.h ('k') | mojo/public/c/system/main.h » ('j') | no next file with comments »
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 #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
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_
OLDNEW
« no previous file with comments | « mojo/public/c/system/handle.h ('k') | mojo/public/c/system/main.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698