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
5151 #define VPX_WITH_ASAN 0
5252 #endif // __has_feature(address_sanitizer) || defined(__SANITIZE_ADDRESS__)
5353
54+#if !defined(__has_attribute)
55+#define __has_attribute(x) 0
56+#endif // !defined(__has_attribute)
57+
5458 #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+//
5662 // -ftrivial-auto-var-init is security risk mitigation feature, so attribute
5763 // 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 quite
59−// effective eleminating unneeded initializations introduced by the flag, e.g.
60−// when they are followed by actual initialization by a program.
64+// bottlenecks when other approaches do not work. In general the compiler is
65+// quite effective at eliminating unneeded initializations introduced by the
66+// flag, e.g. when they are followed by actual initialization by a program.
6167 // However if compiler optimization fails and code refactoring is hard, the
6268 // attribute can be used as a workaround.
6369 #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