OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef BASE_FILES_FILE_POSIX_HOOKS_INTERNAL_H_ |
| 6 #define BASE_FILES_FILE_POSIX_HOOKS_INTERNAL_H_ |
| 7 |
| 8 #include "base/base_export.h" |
| 9 |
| 10 namespace base { |
| 11 |
| 12 // Define empty hooks for blacklisting file descriptors used in base::File. |
| 13 // These functions should be declared 'weak', i.e. the functions declared in |
| 14 // a default way would have precedence over the weak ones at link time. This |
| 15 // works for both static and dynamic linking. |
| 16 // TODO(pasko): Remove these hooks when crbug.com/424562 is fixed. |
| 17 // |
| 18 // With compilers other than GCC/Clang define strong no-op symbols for |
| 19 // simplicity. |
| 20 #if defined(COMPILER_GCC) |
| 21 #define ATTRIBUTE_WEAK __attribute__ ((weak)) |
| 22 #else |
| 23 #define ATTRIBUTE_WEAK |
| 24 #endif |
| 25 BASE_EXPORT void ProtectFileDescriptor(int fd) ATTRIBUTE_WEAK; |
| 26 BASE_EXPORT void UnprotectFileDescriptor(int fd) ATTRIBUTE_WEAK; |
| 27 #undef ATTRIBUTE_WEAK |
| 28 |
| 29 } // namespace base |
| 30 |
| 31 #endif // BASE_FILES_FILE_POSIX_HOOKS_INTERNAL_H_ |
OLD | NEW |