Chromium Code Reviews

Side by Side Diff: base/compiler_specific.h

Issue 6165001: Support OVERRIDE for clang. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | | Annotate | Revision Log
« no previous file with comments | « no previous file | 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 (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 BASE_COMPILER_SPECIFIC_H_ 5 #ifndef BASE_COMPILER_SPECIFIC_H_
6 #define BASE_COMPILER_SPECIFIC_H_ 6 #define BASE_COMPILER_SPECIFIC_H_
7 #pragma once 7 #pragma once
8 8
9 #include "build/build_config.h" 9 #include "build/build_config.h"
10 10
(...skipping 66 matching lines...)
77 #else 77 #else
78 #define ALLOW_UNUSED 78 #define ALLOW_UNUSED
79 #endif 79 #endif
80 80
81 // Annotate a virtual method indicating it must be overriding a virtual 81 // Annotate a virtual method indicating it must be overriding a virtual
82 // method in the parent class. 82 // method in the parent class.
83 // Use like: 83 // Use like:
84 // virtual void foo() OVERRIDE; 84 // virtual void foo() OVERRIDE;
85 #if defined(COMPILER_MSVC) 85 #if defined(COMPILER_MSVC)
86 #define OVERRIDE override 86 #define OVERRIDE override
87 #elif defined(__clang__)
88 #define OVERRIDE __attribute__((override))
87 #else 89 #else
88 #define OVERRIDE 90 #define OVERRIDE
89 #endif 91 #endif
90 92
91 // Annotate a function indicating the caller must examine the return value. 93 // Annotate a function indicating the caller must examine the return value.
92 // Use like: 94 // Use like:
93 // int foo() WARN_UNUSED_RESULT; 95 // int foo() WARN_UNUSED_RESULT;
94 #if defined(COMPILER_GCC) 96 #if defined(COMPILER_GCC)
95 #define WARN_UNUSED_RESULT __attribute__((warn_unused_result)) 97 #define WARN_UNUSED_RESULT __attribute__((warn_unused_result))
96 #else 98 #else
(...skipping 13 matching lines...)
110 #endif 112 #endif
111 113
112 // WPRINTF_FORMAT is the same, but for wide format strings. 114 // WPRINTF_FORMAT is the same, but for wide format strings.
113 // This doesn't appear to yet be implemented in any compiler. 115 // This doesn't appear to yet be implemented in any compiler.
114 // See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38308 . 116 // See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38308 .
115 #define WPRINTF_FORMAT(format_param, dots_param) 117 #define WPRINTF_FORMAT(format_param, dots_param)
116 // If available, it would look like: 118 // If available, it would look like:
117 // __attribute__((format(wprintf, format_param, dots_param))) 119 // __attribute__((format(wprintf, format_param, dots_param)))
118 120
119 #endif // BASE_COMPILER_SPECIFIC_H_ 121 #endif // BASE_COMPILER_SPECIFIC_H_
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine