OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2011 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 CHROME_BROWSER_MAC_CLOSURE_LEOPARD_COMPAT_BLOCK_H_ |
| 6 #define CHROME_BROWSER_MAC_CLOSURE_LEOPARD_COMPAT_BLOCK_H_ |
| 7 #pragma once |
| 8 |
| 9 // __NSConcreteGlobalBlock is a private implementation detail of libclosure |
| 10 // defined in libclosure/libclosure-38/Block_private.h, but it's exposed from |
| 11 // libSystem as a public symbol, and the block-enabled compiler will emit code |
| 12 // that references this symbol. Because the symbol is not present in 10.5's |
| 13 // libSystem, it must be declared as a weak import in any file that uses |
| 14 // blocks. Any block-using file must #include this header to guarantee that |
| 15 // the symbol will show up in linked output as a weak import when compiling |
| 16 // for a 10.5 deployment target. Because the symbol is always present in 10.6 |
| 17 // and higher, it does not need to be a weak import when the deployment target |
| 18 // is at least 10.6. |
| 19 |
| 20 #include <AvailabilityMacros.h> |
| 21 |
| 22 #if MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_5 // DT <= 10.5 |
| 23 |
| 24 extern "C" { |
| 25 |
| 26 __attribute__((weak_import)) extern void* _NSConcreteGlobalBlock[32]; |
| 27 |
| 28 } // extern "C" |
| 29 |
| 30 #endif // DT <= 10.5 |
| 31 |
| 32 #endif // CHROME_BROWSER_MAC_CLOSURE_LEOPARD_COMPAT_BLOCK_H_ |
OLD | NEW |