diff options
author | ajwong@chromium.org <ajwong@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-16 00:11:07 +0000 |
---|---|---|
committer | ajwong@chromium.org <ajwong@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-16 00:11:07 +0000 |
commit | 5214f719b7009c844604ffca4a24d741ec10bb6d (patch) | |
tree | 1a031b75bf46a55ab5380c7eb85bf9ca25338f15 /third_party/ffmpeg | |
parent | bacc94464e429a3c650158f3d5c786752506a98c (diff) | |
download | chromium_src-5214f719b7009c844604ffca4a24d741ec10bb6d.zip chromium_src-5214f719b7009c844604ffca4a24d741ec10bb6d.tar.gz chromium_src-5214f719b7009c844604ffca4a24d741ec10bb6d.tar.bz2 |
Make the generated stubs weak. Enable the unittests that had conflicting symbols.
Also move some of the old mocks into their own namespace. They were causing linker confusion due to inlining or something which generated bad test executables that segfaulted.
Review URL: http://codereview.chromium.org/126170
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18457 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'third_party/ffmpeg')
-rwxr-xr-x | third_party/ffmpeg/generate_stubs.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/third_party/ffmpeg/generate_stubs.py b/third_party/ffmpeg/generate_stubs.py index 5e37157..948ed4a 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'], |