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

Unified Diff: third_party/ffmpeg/generate_stubs.py

Issue 126170: Make the generated stubs weak. Enable the unittests that had conflicting symbols. (Closed)
Patch Set: Fix indent.w Created 11 years, 6 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
« no previous file with comments | « media/media.gyp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/ffmpeg/generate_stubs.py
diff --git a/third_party/ffmpeg/generate_stubs.py b/third_party/ffmpeg/generate_stubs.py
index 5e3715719a67e7a95796f98635ada093611472e7..948ed4ab5b26f7b712d35a8b7fbd44e064695802 100755
--- a/third_party/ffmpeg/generate_stubs.py
+++ b/third_party/ffmpeg/generate_stubs.py
@@ -377,6 +377,10 @@ class PosixStubWriter(object):
def StubFunction(cls, signature):
"""Generates a stub function definition for the given signature.
+ The function definitions are created with __attribute__((weak)) so that
+ they may be overridden by a real static link or mock versions to be used
+ when testing.
+
Args:
signature: The hash representing the function signature.
@@ -395,7 +399,8 @@ class PosixStubWriter(object):
if arg_list == 'void':
arg_list = ''
- return """%(return_type)s %(name)s(%(params)s) {
+ return """extern %(return_type)s %(name)s(%(params)s) __attribute__((weak));
+%(return_type)s %(name)s(%(params)s) {
%(return_prefix)s%(name)s_ptr(%(arg_list)s);
}""" % {'return_type': signature['return_type'],
'name': signature['name'],
« no previous file with comments | « media/media.gyp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698