<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[180476] trunk/Source/WebCore</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/180476">180476</a></dd>
<dt>Author</dt> <dd>ddkilzer@apple.com</dd>
<dt>Date</dt> <dd>2015-02-20 20:09:02 -0800 (Fri, 20 Feb 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>Make namespace configurable for SOFT_LINK_*_{HEADER,SOURCE}() macros
<http://webkit.org/b/141849>
Reviewed by Brent Fulgham.
This patch does the following:
- Add namespace argument to the SOFT_LINK_*_{HEADER,SOURCE}()
macros for reuse in other projects.
- Adds SOFT_LINK_FRAMEWORK_SOURCE() macro in preparation for Bug
141816.
- Adds back framework argument to SOFT_LINK_FUNCTION_HEADER()
and includes framework name in generated function names. This
adds more entropy to the names in case there are two functions
with the same name in different frameworks.
* platform/cf/CoreMediaSoftLink.cpp:
- Add FIXME about USE(COREMEDIA).
- Switch from SOFT_LINK_FRAMEWORK() to
SOFT_LINK_FRAMEWORK_SOURCE().
* platform/cf/CoreMediaSoftLink.h:
- Add FIXME about USE(COREMEDIA).
- Add back framework argument to SOFT_LINK_FUNCTION_HEADER()
macros.
* platform/mac/SoftLinking.h:
- Add missing header guards.
- Add pragmas for different macro groups.
(SOFT_LINK_FRAMEWORK_SOURCE): Add.
(SOFT_LINK_FUNCTION_HEADER): Move. Add back framework argument.
(SOFT_LINK_FUNCTION_SOURCE): Move.
- Add framework name to generated function names.
- Incorporates namespace so that it doesn't have to be listed in
the *SoftLink.{cpp,h} file.
* platform/win/SoftLinking.h:
- Add pragmas for different macro groups.
(SOFT_LINK_FRAMEWORK_SOURCE): Add.
(SOFT_LINK_FUNCTION_HEADER): Move. Add back framework argument.
(SOFT_LINK_FUNCTION_SOURCE): Move.
- Add framework name to generated function names.
- Incorporates namespace so that it doesn't have to be listed in
the *SoftLink.{cpp,h} file.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreplatformcfCoreMediaSoftLinkcpp">trunk/Source/WebCore/platform/cf/CoreMediaSoftLink.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformcfCoreMediaSoftLinkh">trunk/Source/WebCore/platform/cf/CoreMediaSoftLink.h</a></li>
<li><a href="#trunkSourceWebCoreplatformmacSoftLinkingh">trunk/Source/WebCore/platform/mac/SoftLinking.h</a></li>
<li><a href="#trunkSourceWebCoreplatformwinSoftLinkingh">trunk/Source/WebCore/platform/win/SoftLinking.h</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (180475 => 180476)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-02-21 03:44:33 UTC (rev 180475)
+++ trunk/Source/WebCore/ChangeLog        2015-02-21 04:09:02 UTC (rev 180476)
</span><span class="lines">@@ -1,3 +1,48 @@
</span><ins>+2015-02-20 David Kilzer <ddkilzer@apple.com>
+
+ Make namespace configurable for SOFT_LINK_*_{HEADER,SOURCE}() macros
+ <http://webkit.org/b/141849>
+
+ Reviewed by Brent Fulgham.
+
+ This patch does the following:
+ - Add namespace argument to the SOFT_LINK_*_{HEADER,SOURCE}()
+ macros for reuse in other projects.
+ - Adds SOFT_LINK_FRAMEWORK_SOURCE() macro in preparation for Bug
+ 141816.
+ - Adds back framework argument to SOFT_LINK_FUNCTION_HEADER()
+ and includes framework name in generated function names. This
+ adds more entropy to the names in case there are two functions
+ with the same name in different frameworks.
+
+ * platform/cf/CoreMediaSoftLink.cpp:
+ - Add FIXME about USE(COREMEDIA).
+ - Switch from SOFT_LINK_FRAMEWORK() to
+ SOFT_LINK_FRAMEWORK_SOURCE().
+ * platform/cf/CoreMediaSoftLink.h:
+ - Add FIXME about USE(COREMEDIA).
+ - Add back framework argument to SOFT_LINK_FUNCTION_HEADER()
+ macros.
+
+ * platform/mac/SoftLinking.h:
+ - Add missing header guards.
+ - Add pragmas for different macro groups.
+ (SOFT_LINK_FRAMEWORK_SOURCE): Add.
+ (SOFT_LINK_FUNCTION_HEADER): Move. Add back framework argument.
+ (SOFT_LINK_FUNCTION_SOURCE): Move.
+ - Add framework name to generated function names.
+ - Incorporates namespace so that it doesn't have to be listed in
+ the *SoftLink.{cpp,h} file.
+
+ * platform/win/SoftLinking.h:
+ - Add pragmas for different macro groups.
+ (SOFT_LINK_FRAMEWORK_SOURCE): Add.
+ (SOFT_LINK_FUNCTION_HEADER): Move. Add back framework argument.
+ (SOFT_LINK_FUNCTION_SOURCE): Move.
+ - Add framework name to generated function names.
+ - Incorporates namespace so that it doesn't have to be listed in
+ the *SoftLink.{cpp,h} file.
+
</ins><span class="cx"> 2015-02-20 Brent Fulgham <bfulgham@apple.com>
</span><span class="cx">
</span><span class="cx"> [Gtk] Unreviewed build fix.
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformcfCoreMediaSoftLinkcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/cf/CoreMediaSoftLink.cpp (180475 => 180476)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/cf/CoreMediaSoftLink.cpp        2015-02-21 03:44:33 UTC (rev 180475)
+++ trunk/Source/WebCore/platform/cf/CoreMediaSoftLink.cpp        2015-02-21 04:09:02 UTC (rev 180476)
</span><span class="lines">@@ -25,32 +25,31 @@
</span><span class="cx"> #include "config.h"
</span><span class="cx">
</span><span class="cx"> #if USE(AVFOUNDATION)
</span><ins>+// FIXME: Should be USE(COREMEDIA), but this isn't currently defined on Windows.
</ins><span class="cx">
</span><span class="cx"> #include "CoreMediaSPI.h"
</span><span class="cx"> #include "SoftLinking.h"
</span><span class="cx"> #include <CoreMedia/CoreMedia.h>
</span><span class="cx">
</span><del>-namespace WebCore {
-SOFT_LINK_FRAMEWORK(CoreMedia)
-}
</del><ins>+SOFT_LINK_FRAMEWORK_SOURCE(WebCore, CoreMedia)
</ins><span class="cx">
</span><del>-SOFT_LINK_FUNCTION_SOURCE(CoreMedia, CMTimeCompare, int32_t, (CMTime time1, CMTime time2), (time1, time2))
-SOFT_LINK_FUNCTION_SOURCE(CoreMedia, CMTimeGetSeconds, Float64, (CMTime time), (time))
-SOFT_LINK_FUNCTION_SOURCE(CoreMedia, CMTimeMake, CMTime, (int64_t value, int32_t timescale), (value, timescale))
-SOFT_LINK_FUNCTION_SOURCE(CoreMedia, CMTimeMakeWithSeconds, CMTime, (Float64 seconds, int32_t preferredTimeScale), (seconds, preferredTimeScale))
-SOFT_LINK_FUNCTION_SOURCE(CoreMedia, CMTimeRangeGetEnd, CMTime, (CMTimeRange range), (range))
</del><ins>+SOFT_LINK_FUNCTION_SOURCE(WebCore, CoreMedia, CMTimeCompare, int32_t, (CMTime time1, CMTime time2), (time1, time2))
+SOFT_LINK_FUNCTION_SOURCE(WebCore, CoreMedia, CMTimeGetSeconds, Float64, (CMTime time), (time))
+SOFT_LINK_FUNCTION_SOURCE(WebCore, CoreMedia, CMTimeMake, CMTime, (int64_t value, int32_t timescale), (value, timescale))
+SOFT_LINK_FUNCTION_SOURCE(WebCore, CoreMedia, CMTimeMakeWithSeconds, CMTime, (Float64 seconds, int32_t preferredTimeScale), (seconds, preferredTimeScale))
+SOFT_LINK_FUNCTION_SOURCE(WebCore, CoreMedia, CMTimeRangeGetEnd, CMTime, (CMTimeRange range), (range))
</ins><span class="cx">
</span><span class="cx"> #if PLATFORM(COCOA)
</span><del>-SOFT_LINK_FUNCTION_SOURCE(CoreMedia, CMNotificationCenterGetDefaultLocalCenter, CMNotificationCenterRef, (void), ());
-SOFT_LINK_FUNCTION_SOURCE(CoreMedia, CMNotificationCenterAddListener, OSStatus, (CMNotificationCenterRef center, const void* listener, CMNotificationCallback callback, CFStringRef notification, const void* object, UInt32 flags), (center, listener, callback, notification, object, flags))
-SOFT_LINK_FUNCTION_SOURCE(CoreMedia, CMNotificationCenterRemoveListener, OSStatus, (CMNotificationCenterRef center, const void* listener, CMNotificationCallback callback, CFStringRef notification, const void* object), (center, listener, callback, notification, object))
-SOFT_LINK_FUNCTION_SOURCE(CoreMedia, CMTimebaseGetTime, CMTime, (CMTimebaseRef timebase), (timebase))
-SOFT_LINK_FUNCTION_SOURCE(CoreMedia, CMTimeCopyAsDictionary, CFDictionaryRef, (CMTime time, CFAllocatorRef allocator), (time, allocator))
</del><ins>+SOFT_LINK_FUNCTION_SOURCE(WebCore, CoreMedia, CMNotificationCenterGetDefaultLocalCenter, CMNotificationCenterRef, (void), ());
+SOFT_LINK_FUNCTION_SOURCE(WebCore, CoreMedia, CMNotificationCenterAddListener, OSStatus, (CMNotificationCenterRef center, const void* listener, CMNotificationCallback callback, CFStringRef notification, const void* object, UInt32 flags), (center, listener, callback, notification, object, flags))
+SOFT_LINK_FUNCTION_SOURCE(WebCore, CoreMedia, CMNotificationCenterRemoveListener, OSStatus, (CMNotificationCenterRef center, const void* listener, CMNotificationCallback callback, CFStringRef notification, const void* object), (center, listener, callback, notification, object))
+SOFT_LINK_FUNCTION_SOURCE(WebCore, CoreMedia, CMTimebaseGetTime, CMTime, (CMTimebaseRef timebase), (timebase))
+SOFT_LINK_FUNCTION_SOURCE(WebCore, CoreMedia, CMTimeCopyAsDictionary, CFDictionaryRef, (CMTime time, CFAllocatorRef allocator), (time, allocator))
</ins><span class="cx"> #endif // PLATFORM(COCOA)
</span><span class="cx">
</span><span class="cx"> #if PLATFORM(WIN)
</span><del>-SOFT_LINK_FUNCTION_SOURCE(CoreMedia, CMTimeAdd, CMTime, (CMTime addend1, CMTime addend2), (addend1, addend2))
-SOFT_LINK_FUNCTION_SOURCE(CoreMedia, CMTimeMakeFromDictionary, CMTime, (CFDictionaryRef dict), (dict))
</del><ins>+SOFT_LINK_FUNCTION_SOURCE(WebCore, CoreMedia, CMTimeAdd, CMTime, (CMTime addend1, CMTime addend2), (addend1, addend2))
+SOFT_LINK_FUNCTION_SOURCE(WebCore, CoreMedia, CMTimeMakeFromDictionary, CMTime, (CFDictionaryRef dict), (dict))
</ins><span class="cx"> #endif // PLATFORM(WIN)
</span><span class="cx">
</span><span class="cx"> #endif // USE(AVFOUNDATION)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformcfCoreMediaSoftLinkh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/cf/CoreMediaSoftLink.h (180475 => 180476)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/cf/CoreMediaSoftLink.h        2015-02-21 03:44:33 UTC (rev 180475)
+++ trunk/Source/WebCore/platform/cf/CoreMediaSoftLink.h        2015-02-21 04:09:02 UTC (rev 180476)
</span><span class="lines">@@ -26,43 +26,44 @@
</span><span class="cx"> #define CoreMediaSoftLink_h
</span><span class="cx">
</span><span class="cx"> #if USE(AVFOUNDATION)
</span><ins>+// FIXME: Should be USE(COREMEDIA), but this isn't currently defined on Windows.
</ins><span class="cx">
</span><span class="cx"> #include "CoreMediaSPI.h"
</span><span class="cx"> #include "SoftLinking.h"
</span><span class="cx"> #include <CoreMedia/CoreMedia.h>
</span><span class="cx">
</span><del>-SOFT_LINK_FUNCTION_HEADER(CMTimeCompare, int32_t, (CMTime time1, CMTime time2), (time1, time2))
-#define CMTimeCompare softLink_CMTimeCompare
-SOFT_LINK_FUNCTION_HEADER(CMTimeGetSeconds, Float64, (CMTime time), (time))
-#define CMTimeGetSeconds softLink_CMTimeGetSeconds
-SOFT_LINK_FUNCTION_HEADER(CMTimeMake, CMTime, (int64_t value, int32_t timescale), (value, timescale))
-#define CMTimeMake softLink_CMTimeMake
-SOFT_LINK_FUNCTION_HEADER(CMTimeMakeWithSeconds, CMTime, (Float64 seconds, int32_t preferredTimeScale), (seconds, preferredTimeScale))
-#define CMTimeMakeWithSeconds softLink_CMTimeMakeWithSeconds
-SOFT_LINK_FUNCTION_HEADER(CMTimeRangeGetEnd, CMTime, (CMTimeRange range), (range))
-#define CMTimeRangeGetEnd softLink_CMTimeRangeGetEnd
</del><ins>+SOFT_LINK_FUNCTION_HEADER(WebCore, CoreMedia, CMTimeCompare, int32_t, (CMTime time1, CMTime time2), (time1, time2))
+#define CMTimeCompare softLink_CoreMedia_CMTimeCompare
+SOFT_LINK_FUNCTION_HEADER(WebCore, CoreMedia, CMTimeGetSeconds, Float64, (CMTime time), (time))
+#define CMTimeGetSeconds softLink_CoreMedia_CMTimeGetSeconds
+SOFT_LINK_FUNCTION_HEADER(WebCore, CoreMedia, CMTimeMake, CMTime, (int64_t value, int32_t timescale), (value, timescale))
+#define CMTimeMake softLink_CoreMedia_CMTimeMake
+SOFT_LINK_FUNCTION_HEADER(WebCore, CoreMedia, CMTimeMakeWithSeconds, CMTime, (Float64 seconds, int32_t preferredTimeScale), (seconds, preferredTimeScale))
+#define CMTimeMakeWithSeconds softLink_CoreMedia_CMTimeMakeWithSeconds
+SOFT_LINK_FUNCTION_HEADER(WebCore, CoreMedia, CMTimeRangeGetEnd, CMTime, (CMTimeRange range), (range))
+#define CMTimeRangeGetEnd softLink_CoreMedia_CMTimeRangeGetEnd
</ins><span class="cx">
</span><span class="cx"> #if PLATFORM(COCOA)
</span><span class="cx">
</span><del>-SOFT_LINK_FUNCTION_HEADER(CMNotificationCenterGetDefaultLocalCenter, CMNotificationCenterRef, (void), ());
-#define CMNotificationCenterGetDefaultLocalCenter softLink_CMNotificationCenterGetDefaultLocalCenter
-SOFT_LINK_FUNCTION_HEADER(CMNotificationCenterAddListener, OSStatus, (CMNotificationCenterRef center, const void* listener, CMNotificationCallback callback, CFStringRef notification, const void* object, UInt32 flags), (center, listener, callback, notification, object, flags))
-#define CMNotificationCenterAddListener softLink_CMNotificationCenterAddListener
-SOFT_LINK_FUNCTION_HEADER(CMNotificationCenterRemoveListener, OSStatus, (CMNotificationCenterRef center, const void* listener, CMNotificationCallback callback, CFStringRef notification, const void* object), (center, listener, callback, notification, object))
-#define CMNotificationCenterRemoveListener softLink_CMNotificationCenterRemoveListener
-SOFT_LINK_FUNCTION_HEADER(CMTimebaseGetTime, CMTime, (CMTimebaseRef timebase), (timebase))
-#define CMTimebaseGetTime softLink_CMTimebaseGetTime
-SOFT_LINK_FUNCTION_HEADER(CMTimeCopyAsDictionary, CFDictionaryRef, (CMTime time, CFAllocatorRef allocator), (time, allocator))
-#define CMTimeCopyAsDictionary softLink_CMTimeCopyAsDictionary
</del><ins>+SOFT_LINK_FUNCTION_HEADER(WebCore, CoreMedia, CMNotificationCenterGetDefaultLocalCenter, CMNotificationCenterRef, (void), ());
+#define CMNotificationCenterGetDefaultLocalCenter softLink_CoreMedia_CMNotificationCenterGetDefaultLocalCenter
+SOFT_LINK_FUNCTION_HEADER(WebCore, CoreMedia, CMNotificationCenterAddListener, OSStatus, (CMNotificationCenterRef center, const void* listener, CMNotificationCallback callback, CFStringRef notification, const void* object, UInt32 flags), (center, listener, callback, notification, object, flags))
+#define CMNotificationCenterAddListener softLink_CoreMedia_CMNotificationCenterAddListener
+SOFT_LINK_FUNCTION_HEADER(WebCore, CoreMedia, CMNotificationCenterRemoveListener, OSStatus, (CMNotificationCenterRef center, const void* listener, CMNotificationCallback callback, CFStringRef notification, const void* object), (center, listener, callback, notification, object))
+#define CMNotificationCenterRemoveListener softLink_CoreMedia_CMNotificationCenterRemoveListener
+SOFT_LINK_FUNCTION_HEADER(WebCore, CoreMedia, CMTimebaseGetTime, CMTime, (CMTimebaseRef timebase), (timebase))
+#define CMTimebaseGetTime softLink_CoreMedia_CMTimebaseGetTime
+SOFT_LINK_FUNCTION_HEADER(WebCore, CoreMedia, CMTimeCopyAsDictionary, CFDictionaryRef, (CMTime time, CFAllocatorRef allocator), (time, allocator))
+#define CMTimeCopyAsDictionary softLink_CoreMedia_CMTimeCopyAsDictionary
</ins><span class="cx">
</span><span class="cx"> #endif // PLATFORM(COCOA)
</span><span class="cx">
</span><span class="cx"> #if PLATFORM(WIN)
</span><span class="cx">
</span><del>-SOFT_LINK_FUNCTION_HEADER(CMTimeAdd, CMTime, (CMTime addend1, CMTime addend2), (addend1, addend2))
-#define CMTimeAdd softLink_CMTimeAdd
-SOFT_LINK_FUNCTION_HEADER(CMTimeMakeFromDictionary, CMTime, (CFDictionaryRef dict), (dict))
-#define CMTimeMakeFromDictionary softLink_CMTimeMakeFromDictionary
</del><ins>+SOFT_LINK_FUNCTION_HEADER(WebCore, CoreMedia, CMTimeAdd, CMTime, (CMTime addend1, CMTime addend2), (addend1, addend2))
+#define CMTimeAdd softLink_CoreMedia_CMTimeAdd
+SOFT_LINK_FUNCTION_HEADER(WebCore, CoreMedia, CMTimeMakeFromDictionary, CMTime, (CFDictionaryRef dict), (dict))
+#define CMTimeMakeFromDictionary softLink_CoreMedia_CMTimeMakeFromDictionary
</ins><span class="cx">
</span><span class="cx"> #endif // PLATFORM(WIN)
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmacSoftLinkingh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mac/SoftLinking.h (180475 => 180476)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mac/SoftLinking.h        2015-02-21 03:44:33 UTC (rev 180475)
+++ trunk/Source/WebCore/platform/mac/SoftLinking.h        2015-02-21 04:09:02 UTC (rev 180476)
</span><span class="lines">@@ -22,6 +22,9 @@
</span><span class="cx"> * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx"> */
</span><span class="cx">
</span><ins>+#ifndef SoftLinking_h
+#define SoftLinking_h
+
</ins><span class="cx"> #import <wtf/Assertions.h>
</span><span class="cx"> #import <dlfcn.h>
</span><span class="cx">
</span><span class="lines">@@ -29,6 +32,8 @@
</span><span class="cx"> #import <objc/runtime.h>
</span><span class="cx"> #endif
</span><span class="cx">
</span><ins>+#pragma mark - Soft-link macros for use within a single source file
+
</ins><span class="cx"> #define SOFT_LINK_LIBRARY(lib) \
</span><span class="cx"> static void* lib##Library() \
</span><span class="cx"> { \
</span><span class="lines">@@ -109,36 +114,6 @@
</span><span class="cx"> return softLink##functionName parameterNames; \
</span><span class="cx"> }
</span><span class="cx">
</span><del>-#define SOFT_LINK_FUNCTION_HEADER(functionName, resultType, parameterDeclarations, parameterNames) \
- WTF_EXTERN_C_BEGIN \
- resultType functionName parameterDeclarations; \
- WTF_EXTERN_C_END \
- namespace WebCore { \
- extern resultType (*softLink##functionName) parameterDeclarations; \
- } \
- inline resultType softLink_##functionName parameterDeclarations \
- { \
- return WebCore::softLink##functionName parameterNames; \
- }
-
-#define SOFT_LINK_FUNCTION_SOURCE(framework, functionName, resultType, parameterDeclarations, parameterNames) \
- WTF_EXTERN_C_BEGIN \
- resultType functionName parameterDeclarations; \
- WTF_EXTERN_C_END \
- namespace WebCore { \
- static resultType init##functionName parameterDeclarations; \
- resultType (*softLink##functionName) parameterDeclarations = init##functionName; \
- static resultType init##functionName parameterDeclarations \
- { \
- static dispatch_once_t once; \
- dispatch_once(&once, ^{ \
- softLink##functionName = (resultType (*) parameterDeclarations) dlsym(framework##Library(), #functionName); \
- ASSERT_WITH_MESSAGE(softLink##functionName, "%s", dlerror()); \
- }); \
- return softLink##functionName parameterNames; \
- } \
- }
-
</del><span class="cx"> #define SOFT_LINK_MAY_FAIL(framework, functionName, resultType, parameterDeclarations, parameterNames) \
</span><span class="cx"> WTF_EXTERN_C_BEGIN \
</span><span class="cx"> resultType functionName parameterDeclarations; \
</span><span class="lines">@@ -313,3 +288,53 @@
</span><span class="cx"> get##name = name##Function; \
</span><span class="cx"> return true; \
</span><span class="cx"> }
</span><ins>+
+#pragma mark - Soft-link macros for sharing across multiple source files
+
+// See Source/WebCore/platform/cf/CoreMediaSoftLink.{cpp,h} for an example implementation.
+
+#define SOFT_LINK_FRAMEWORK_SOURCE(functionNamespace, framework) \
+ namespace functionNamespace { \
+ static void* framework##Library() \
+ { \
+ static void* frameworkLibrary; \
+ static dispatch_once_t once; \
+ dispatch_once(&once, ^{ \
+ frameworkLibrary = dlopen("/System/Library/Frameworks/" #framework ".framework/" #framework, RTLD_NOW); \
+ ASSERT_WITH_MESSAGE(frameworkLibrary, "%s", dlerror()); \
+ }); \
+ return frameworkLibrary; \
+ } \
+ }
+
+#define SOFT_LINK_FUNCTION_HEADER(functionNamespace, framework, functionName, resultType, parameterDeclarations, parameterNames) \
+ WTF_EXTERN_C_BEGIN \
+ resultType functionName parameterDeclarations; \
+ WTF_EXTERN_C_END \
+ namespace functionNamespace { \
+ extern resultType (*softLink##framework##functionName) parameterDeclarations; \
+ inline resultType softLink_##framework##_##functionName parameterDeclarations \
+ { \
+ return softLink##framework##functionName parameterNames; \
+ } \
+ }
+
+#define SOFT_LINK_FUNCTION_SOURCE(functionNamespace, framework, functionName, resultType, parameterDeclarations, parameterNames) \
+ WTF_EXTERN_C_BEGIN \
+ resultType functionName parameterDeclarations; \
+ WTF_EXTERN_C_END \
+ namespace functionNamespace { \
+ static resultType init##framework##functionName parameterDeclarations; \
+ resultType (*softLink##framework##functionName) parameterDeclarations = init##framework##functionName; \
+ static resultType init##framework##functionName parameterDeclarations \
+ { \
+ static dispatch_once_t once; \
+ dispatch_once(&once, ^{ \
+ softLink##framework##functionName = (resultType (*) parameterDeclarations) dlsym(framework##Library(), #functionName); \
+ ASSERT_WITH_MESSAGE(softLink##framework##functionName, "%s", dlerror()); \
+ }); \
+ return softLink##framework##functionName parameterNames; \
+ } \
+ }
+
+#endif // SoftLinking_h
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformwinSoftLinkingh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/win/SoftLinking.h (180475 => 180476)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/win/SoftLinking.h        2015-02-21 03:44:33 UTC (rev 180475)
+++ trunk/Source/WebCore/platform/win/SoftLinking.h        2015-02-21 04:09:02 UTC (rev 180476)
</span><span class="lines">@@ -28,11 +28,7 @@
</span><span class="cx"> #include <windows.h>
</span><span class="cx"> #include <wtf/Assertions.h>
</span><span class="cx">
</span><del>-#ifdef DEBUG_ALL
-#define SOFT_LINK_FRAMEWORK(framework) SOFT_LINK_DEBUG_LIBRARY(framework)
-#else
-#define SOFT_LINK_FRAMEWORK(framework) SOFT_LINK_LIBRARY(framework)
-#endif
</del><ins>+#pragma mark - Soft-link helper macros
</ins><span class="cx">
</span><span class="cx"> #define SOFT_LINK_LIBRARY_HELPER(lib, suffix) \
</span><span class="cx"> static HMODULE lib##Library() \
</span><span class="lines">@@ -45,6 +41,8 @@
</span><span class="cx"> #define SOFT_LINK_LIBRARY(lib) SOFT_LINK_LIBRARY_HELPER(lib, L".dll")
</span><span class="cx"> #define SOFT_LINK_DEBUG_LIBRARY(lib) SOFT_LINK_LIBRARY_HELPER(lib, L"_debug.dll")
</span><span class="cx">
</span><ins>+#pragma mark - Soft-link macros for use within a single source file
+
</ins><span class="cx"> #define SOFT_LINK(library, functionName, resultType, callingConvention, parameterDeclarations, parameterNames) \
</span><span class="cx"> static resultType callingConvention init##functionName parameterDeclarations; \
</span><span class="cx"> static resultType (callingConvention*softLink##functionName) parameterDeclarations = init##functionName; \
</span><span class="lines">@@ -116,27 +114,6 @@
</span><span class="cx"> return softLink##functionName parameterNames; \
</span><span class="cx"> }
</span><span class="cx">
</span><del>-#define SOFT_LINK_FUNCTION_HEADER(functionName, resultType, parameterDeclarations, parameterNames) \
- namespace WebCore { \
- extern resultType(__cdecl*softLink##functionName) parameterDeclarations; \
- } \
- inline resultType softLink_##functionName parameterDeclarations \
- { \
- return WebCore::softLink##functionName parameterNames; \
- }
-
-#define SOFT_LINK_FUNCTION_SOURCE(library, functionName, resultType, parameterDeclarations, parameterNames) \
- namespace WebCore { \
- static resultType __cdecl init##functionName parameterDeclarations; \
- resultType(__cdecl*softLink##functionName) parameterDeclarations = init##functionName; \
- static resultType __cdecl init##functionName parameterDeclarations \
- { \
- softLink##functionName = reinterpret_cast<resultType (__cdecl*)parameterDeclarations>(SOFT_LINK_GETPROCADDRESS(library##Library(), #functionName)); \
- ASSERT(softLink##functionName); \
- return softLink##functionName parameterNames; \
- } \
- }
-
</del><span class="cx"> #define SOFT_LINK_DLL_IMPORT_OPTIONAL(library, functionName, resultType, callingConvention, parameterDeclarations) \
</span><span class="cx"> typedef resultType (callingConvention *functionName##PtrType) parameterDeclarations; \
</span><span class="cx"> static functionName##PtrType functionName##Ptr() \
</span><span class="lines">@@ -194,4 +171,41 @@
</span><span class="cx"> return *ptr; \
</span><span class="cx"> } \
</span><span class="cx">
</span><ins>+#pragma mark - Soft-link macros for sharing across multiple source files
+
+// See Source/WebCore/platform/cf/CoreMediaSoftLink.{cpp,h} for an example implementation.
+
+#ifdef DEBUG_ALL
+#define SOFT_LINK_FRAMEWORK_SOURCE(functionNamespace, framework) \
+ namespace functionNamespace { \
+ SOFT_LINK_DEBUG_LIBRARY(framework) \
+ }
+#else
+#define SOFT_LINK_FRAMEWORK_SOURCE(functionNamespace, framework) \
+ namespace functionNamespace { \
+ SOFT_LINK_LIBRARY(framework) \
+ }
+#endif
+
+#define SOFT_LINK_FUNCTION_HEADER(functionNamespace, framework, functionName, resultType, parameterDeclarations, parameterNames) \
+ namespace functionNamespace { \
+ extern resultType(__cdecl*softLink##framework##functionName) parameterDeclarations; \
+ inline resultType softLink_##framework##_##functionName parameterDeclarations \
+ { \
+ return softLink##framework##functionName parameterNames; \
+ } \
+ }
+
+#define SOFT_LINK_FUNCTION_SOURCE(functionNamespace, framework, functionName, resultType, parameterDeclarations, parameterNames) \
+ namespace functionNamespace { \
+ static resultType __cdecl init##framework##functionName parameterDeclarations; \
+ resultType(__cdecl*softLink##framework##functionName) parameterDeclarations = init##framework##functionName; \
+ static resultType __cdecl init##framework##functionName parameterDeclarations \
+ { \
+ softLink##framework##functionName = reinterpret_cast<resultType (__cdecl*)parameterDeclarations>(SOFT_LINK_GETPROCADDRESS(framework##Library(), #functionName)); \
+ ASSERT(softLink##framework##functionName); \
+ return softLink##framework##functionName parameterNames; \
+ } \
+ }
+
</ins><span class="cx"> #endif // SoftLinking_h
</span></span></pre>
</div>
</div>
</body>
</html>