Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2085)

Unified Diff: chrome/browser/mac/closure_leopard_compat/block.h

Issue 7582032: Allow use of ^blocks, even with the 10.5 SDK, and even with a 10.5 runtime (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/mac/closure_leopard_compat/block.h
===================================================================
--- chrome/browser/mac/closure_leopard_compat/block.h (revision 0)
+++ chrome/browser/mac/closure_leopard_compat/block.h (revision 0)
@@ -0,0 +1,32 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_MAC_CLOSURE_LEOPARD_COMPAT_BLOCK_H_
+#define CHROME_BROWSER_MAC_CLOSURE_LEOPARD_COMPAT_BLOCK_H_
+#pragma once
+
+// __NSConcreteGlobalBlock is a private implementation detail of libclosure
+// defined in libclosure/libclosure-38/Block_private.h, but it's exposed from
+// libSystem as a public symbol, and the block-enabled compiler will emit code
+// that references this symbol. Because the symbol is not present in 10.5's
+// libSystem, it must be declared as a weak import in any file that uses
+// blocks. Any block-using file must #include this header to guarantee that
+// the symbol will show up in linked output as a weak import when compiling
+// for a 10.5 deployment target. Because the symbol is always present in 10.6
+// and higher, it does not need to be a weak import when the deployment target
+// is at least 10.6.
+
+#include <AvailabilityMacros.h>
+
+#if MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_5 // DT <= 10.5
+
+extern "C" {
+
+__attribute__((weak_import)) extern void* _NSConcreteGlobalBlock[32];
Mark Mentovai 2011/08/08 18:30:21 Nico: FYI: References to _NSConcreteGlobalBlock ar
+
+} // extern "C"
+
+#endif // DT <= 10.5
+
+#endif // CHROME_BROWSER_MAC_CLOSURE_LEOPARD_COMPAT_BLOCK_H_
Property changes on: chrome/browser/mac/closure_leopard_compat/block.h
___________________________________________________________________
Added: svn:eol-style
+ LF

Powered by Google App Engine
This is Rietveld 408576698