diff options
author | Ben Murdoch <benm@google.com> | 2009-08-11 17:01:47 +0100 |
---|---|---|
committer | Ben Murdoch <benm@google.com> | 2009-08-11 18:21:02 +0100 |
commit | 0bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5 (patch) | |
tree | 2943df35f62d885c89d01063cc528dd73b480fea /WebCore/platform/win/SoftLinking.h | |
parent | 7e7a70bfa49a1122b2597a1e6367d89eb4035eca (diff) | |
download | external_webkit-0bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5.zip external_webkit-0bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5.tar.gz external_webkit-0bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5.tar.bz2 |
Merge in WebKit r47029.
Diffstat (limited to 'WebCore/platform/win/SoftLinking.h')
-rw-r--r-- | WebCore/platform/win/SoftLinking.h | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/WebCore/platform/win/SoftLinking.h b/WebCore/platform/win/SoftLinking.h index 761cb7a..bb06672 100644 --- a/WebCore/platform/win/SoftLinking.h +++ b/WebCore/platform/win/SoftLinking.h @@ -49,7 +49,7 @@ \ static resultType callingConvention init##functionName parameterDeclarations \ { \ - softLink##functionName = (resultType (callingConvention*) parameterDeclarations) GetProcAddress(library##Library(), #functionName); \ + softLink##functionName = reinterpret_cast<resultType (callingConvention*) parameterDeclarations>(GetProcAddress(library##Library(), #functionName)); \ ASSERT(softLink##functionName); \ return softLink##functionName parameterNames; \ }\ @@ -59,4 +59,19 @@ return softLink##functionName parameterNames; \ } +#define SOFT_LINK_OPTIONAL(library, functionName, resultType, callingConvention, parameterDeclarations) \ + typedef resultType (callingConvention *functionName##PtrType) parameterDeclarations; \ + static functionName##PtrType functionName##Ptr() \ + { \ + static functionName##PtrType ptr; \ + static bool initialized; \ + \ + if (initialized) \ + return ptr; \ + initialized = true; \ + \ + ptr = reinterpret_cast<functionName##PtrType>(GetProcAddress(library##Library(), #functionName)); \ + return ptr; \ + }\ + #endif // SoftLinking_h |