History

fix __has_attribute in visual studio

Similar to __has_feature, __has_attribute needs to be defined away on unsupported platforms. BUG=chromium:1020220,chromium:977230

Johann committed 6 years ago

Commit 2ed18301 parent 4529dc81 file · +10 −4Browse files

Unified · Split

vpx_ports/mem.h+10−4
@@ -51,13 +51,19 @@ · 50 unmodified lines
51#define VPX_WITH_ASAN 051#define VPX_WITH_ASAN 0
52#endif // __has_feature(address_sanitizer) || defined(__SANITIZE_ADDRESS__)52#endif // __has_feature(address_sanitizer) || defined(__SANITIZE_ADDRESS__)
53 53
54#if !defined(__has_attribute)
55#define __has_attribute(x) 0
56#endif // !defined(__has_attribute)
57
54#if __has_attribute(uninitialized)58#if __has_attribute(uninitialized)
55// Attribute disables -ftrivial-auto-var-init=pattern for specific variables.59// Attribute "uninitialized" disables -ftrivial-auto-var-init=pattern for
60// the specified variable.
61//
56// -ftrivial-auto-var-init is security risk mitigation feature, so attribute62// -ftrivial-auto-var-init is security risk mitigation feature, so attribute
57// should not be used "just in case", but only to fix real performance63// should not be used "just in case", but only to fix real performance
58// bottlenecks when other approaches do not work. In general compiler is quite64// bottlenecks when other approaches do not work. In general the compiler is
59// effective eleminating unneeded initializations introduced by the flag, e.g.65// quite effective at eliminating unneeded initializations introduced by the
60// when they are followed by actual initialization by a program.66// flag, e.g. when they are followed by actual initialization by a program.
61// However if compiler optimization fails and code refactoring is hard, the67// However if compiler optimization fails and code refactoring is hard, the
62// attribute can be used as a workaround.68// attribute can be used as a workaround.
63#define VPX_UNINITIALIZED __attribute__((uninitialized))69#define VPX_UNINITIALIZED __attribute__((uninitialized))

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t