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

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

Issue 428613003: Make compile with gcc 4.7 work (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/extensions/api/system_cpu/cpu_info_provider_linux.cc ('k') | no next file » | 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 #else 66 #else
67 #error "Please define MOJO_ALIGNOF() for your compiler." 67 #error "Please define MOJO_ALIGNOF() for your compiler."
68 #endif 68 #endif
69 69
70 // Specify the alignment of a |struct|, etc. 70 // Specify the alignment of a |struct|, etc.
71 // Use like: 71 // Use like:
72 // struct MOJO_ALIGNAS(8) Foo { ... }; 72 // struct MOJO_ALIGNAS(8) Foo { ... };
73 // Unlike the C++11 |alignas()|, |alignment| must be an integer. It may not be a 73 // Unlike the C++11 |alignas()|, |alignment| must be an integer. It may not be a
74 // type, nor can it be an expression like |MOJO_ALIGNOF(type)| (due to the 74 // type, nor can it be an expression like |MOJO_ALIGNOF(type)| (due to the
75 // non-C++11 MSVS version). 75 // non-C++11 MSVS version).
76 #if __cplusplus >= 201103L 76 #if __cplusplus >= 201103L && \
77 (defined(__clang__) || (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 >= 40800))
viettrungluu 2014/07/29 17:47:28 What about future versions of MSVC? This would be
77 #define MOJO_ALIGNAS(alignment) alignas(alignment) 78 #define MOJO_ALIGNAS(alignment) alignas(alignment)
78 #elif defined(__GNUC__) 79 #elif defined(__GNUC__)
79 #define MOJO_ALIGNAS(alignment) __attribute__((aligned(alignment))) 80 #define MOJO_ALIGNAS(alignment) __attribute__((aligned(alignment)))
80 #elif defined(_MSC_VER) 81 #elif defined(_MSC_VER)
81 #define MOJO_ALIGNAS(alignment) __declspec(align(alignment)) 82 #define MOJO_ALIGNAS(alignment) __declspec(align(alignment))
82 #else 83 #else
83 #error "Please define MOJO_ALIGNAS() for your compiler." 84 #error "Please define MOJO_ALIGNAS() for your compiler."
84 #endif 85 #endif
85 86
86 #endif // MOJO_PUBLIC_C_SYSTEM_MACROS_H_ 87 #endif // MOJO_PUBLIC_C_SYSTEM_MACROS_H_
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/system_cpu/cpu_info_provider_linux.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698