Changeset 238541 in webkit
- Timestamp:
- Nov 26, 2018 6:01:07 PM (5 years ago)
- Location:
- trunk/Source/WTF
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WTF/ChangeLog
r238504 r238541 1 2018-11-26 Fujii Hironori <Hironori.Fujii@sony.com> 2 3 [Win][Clang] SOFT_LINK reports warning: implicit conversion between pointer-to-function and pointer-to-object is a Microsoft extension [-Wmicrosoft-cast] 4 https://bugs.webkit.org/show_bug.cgi?id=191960 5 6 Reviewed by Alex Christensen. 7 8 * wtf/win/SoftLinking.h: Do reinterpret_cast<void*> a function 9 pointer argument of EncodePointer. Changed the type of stored 10 function pointer returned by EncodePointer. 11 1 12 2018-11-26 Sam Weinig <sam@webkit.org> 2 13 -
trunk/Source/WTF/wtf/win/SoftLinking.h
r219191 r238541 44 44 45 45 #define SOFT_LINK(library, functionName, resultType, callingConvention, parameterDeclarations, parameterNames) \ 46 static resultType(callingConvention*softLink##functionName) parameterDeclarations = nullptr; \46 static void* softLink##functionName; \ 47 47 \ 48 48 inline resultType functionName parameterDeclarations \ 49 49 { \ 50 50 if (!softLink##functionName) \ 51 softLink##functionName = reinterpret_cast<resultType(callingConvention*)parameterDeclarations>(::EncodePointer(SOFT_LINK_GETPROCADDRESS(library##Library(), #functionName))); \51 softLink##functionName = ::EncodePointer(reinterpret_cast<void*>(SOFT_LINK_GETPROCADDRESS(library##Library(), #functionName))); \ 52 52 return reinterpret_cast<resultType (callingConvention*) parameterDeclarations>(::DecodePointer(softLink##functionName)) parameterNames; \ 53 53 } … … 57 57 static functionName##PtrType functionName##Ptr() \ 58 58 { \ 59 static functionName##PtrTypeptr; \59 static void* ptr; \ 60 60 static bool initialized; \ 61 61 \ 62 62 if (!initialized) { \ 63 ptr = reinterpret_cast<functionName##PtrType>(::EncodePointer(SOFT_LINK_GETPROCADDRESS(library##Library(), #functionName))); \63 ptr = ::EncodePointer(reinterpret_cast<void*>(SOFT_LINK_GETPROCADDRESS(library##Library(), #functionName))); \ 64 64 initialized = true; \ 65 65 } \ … … 71 71 static functionName##PtrType functionName##Ptr() \ 72 72 { \ 73 static functionName##PtrTypeptr; \73 static void* ptr; \ 74 74 static bool initialized; \ 75 75 \ 76 76 if (!initialized) { \ 77 77 static HINSTANCE libraryInstance = ::GetModuleHandle(L#library); \ 78 ptr = reinterpret_cast<functionName##PtrType>(::EncodePointer(SOFT_LINK_GETPROCADDRESS(libraryInstance, #functionName))); \78 ptr = ::EncodePointer(reinterpret_cast<void*>(SOFT_LINK_GETPROCADDRESS(libraryInstance, #functionName))); \ 79 79 initialized = true; \ 80 80 } \ … … 91 91 */ 92 92 #define SOFT_LINK_DLL_IMPORT(library, functionName, resultType, callingConvention, parameterDeclarations, parameterNames) \ 93 static resultType(callingConvention*softLink##functionName) parameterDeclarations = nullptr; \93 static void* softLink##functionName; \ 94 94 \ 95 95 inline resultType softLink_##functionName parameterDeclarations \ 96 96 { \ 97 97 if (!softLink##functionName) \ 98 softLink##functionName = reinterpret_cast<resultType(callingConvention*)parameterDeclarations>(::EncodePointer(SOFT_LINK_GETPROCADDRESS(library##Library(), #functionName))); \98 softLink##functionName = ::EncodePointer(reinterpret_cast<void*>(SOFT_LINK_GETPROCADDRESS(library##Library(), #functionName))); \ 99 99 return reinterpret_cast<resultType(callingConvention*)parameterDeclarations>(::DecodePointer(softLink##functionName)) parameterNames; \ 100 100 } … … 104 104 static functionName##PtrType functionName##Ptr() \ 105 105 { \ 106 static functionName##PtrTypeptr; \106 static void* ptr; \ 107 107 static bool initialized; \ 108 108 \ 109 109 if (!initialized) { \ 110 ptr = reinterpret_cast<resultType(callingConvention*)parameterDeclarations>(::EncodePointer(SOFT_LINK_GETPROCADDRESS(library##Library(), #functionName))); \110 ptr = ::EncodePointer(reinterpret_cast<void*>(SOFT_LINK_GETPROCADDRESS(library##Library(), #functionName))); \ 111 111 initialized = true; \ 112 112 } \ … … 118 118 static functionName##PtrType functionName##Ptr() \ 119 119 { \ 120 static functionName##PtrTypeptr; \120 static void* ptr; \ 121 121 static bool initialized; \ 122 122 \ 123 123 if (!initialized) { \ 124 ptr = reinterpret_cast<resultType(callingConvention*)parameterDeclarations>(::EncodePointer(SOFT_LINK_GETPROCADDRESS(library##Library(), #functionName))); \124 ptr = ::EncodePointer(reinterpret_cast<void*>(SOFT_LINK_GETPROCADDRESS(library##Library(), #functionName))); \ 125 125 initialized = true; \ 126 126 } \
Note: See TracChangeset
for help on using the changeset viewer.