Bug 179893

Summary: Add declspec within WebKit API
Product: WebKit Reporter: Don Olmstead <don.olmstead>
Component: WebKit APIAssignee: Don Olmstead <don.olmstead>
Status: RESOLVED FIXED    
Severity: Normal CC: achristensen, bfulgham, commit-queue, darin, rniwa, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
darin: review+
Patch none

Don Olmstead
Reported 2017-11-20 12:09:13 PST
Add __declspec to WebKit API for Windows.
Attachments
Patch (1.44 KB, patch)
2017-11-20 12:12 PST, Don Olmstead
no flags
Patch (1.61 KB, patch)
2017-11-20 15:10 PST, Don Olmstead
darin: review+
Patch (1.55 KB, patch)
2017-11-20 17:18 PST, Don Olmstead
no flags
Don Olmstead
Comment 1 2017-11-20 12:12:20 PST
Created attachment 327371 [details] Patch Adds declspec export/import along with a check for clang support of it.
Darin Adler
Comment 2 2017-11-20 13:52:25 PST
Comment on attachment 327371 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=327371&action=review > Source/WebKit/Shared/API/c/WKDeclarationSpecifiers.h:33 > +#if !defined(__has_declspec_attribute) > +#define __has_declspec_attribute(x) 0 > +#endif I suggest putting this in a separate paragraph, not inside the WK_EXPORT paragraph. As is done with __has_extension and __has_attribute below. Also, should use ifndef as all the others do. > Source/WebKit/Shared/API/c/WKDeclarationSpecifiers.h:41 > +#endif /* BUILDING_WEBKIT */ Regardless of the overall merits of this patch, it’d not good to have a comment here that does not match the #if above. The thing about is BUILDING_WebKit, but the comment says BUILDING_WEBKIT.
Don Olmstead
Comment 3 2017-11-20 15:10:10 PST
Created attachment 327377 [details] Patch Updating based on review comments. Adding RealView ARM Compiler support of declspec.
Darin Adler
Comment 4 2017-11-20 16:28:34 PST
Comment on attachment 327377 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=327377&action=review Seems OK to land it like this, although it doesn’t seem exactly right. > Source/WebKit/Shared/API/c/WKDeclarationSpecifiers.h:36 > +#ifndef __has_declspec_attribute > +#if defined(WIN32) || defined(_WIN32) || defined(__CC_ARM) || defined(__ARMCC__) > +#define __has_declspec_attribute(x) 1 > +#else > +#define __has_declspec_attribute(x) 0 > +#endif > +#endif This doesn’t seem quite right to me; it’s not great that __has_declspec_attribute(THIS_DECLSPEC_ATTRIBUTE_IS_BOGUS_AND_DOES_NOT_EXIST) will return true on many platforms.
Don Olmstead
Comment 5 2017-11-20 16:46:43 PST
(In reply to Darin Adler from comment #4) > Comment on attachment 327377 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=327377&action=review > > Seems OK to land it like this, although it doesn’t seem exactly right. > > > Source/WebKit/Shared/API/c/WKDeclarationSpecifiers.h:36 > > +#ifndef __has_declspec_attribute > > +#if defined(WIN32) || defined(_WIN32) || defined(__CC_ARM) || defined(__ARMCC__) > > +#define __has_declspec_attribute(x) 1 > > +#else > > +#define __has_declspec_attribute(x) 0 > > +#endif > > +#endif > > This doesn’t seem quite right to me; it’s not great that > __has_declspec_attribute(THIS_DECLSPEC_ATTRIBUTE_IS_BOGUS_AND_DOES_NOT_EXIST) > will return true on many platforms. Would you prefer it to do #ifndef __has_declspec_attribute #define __has_declspec_attribute(x) 0 #endif then use it like #elif defined(WIN32) || defined(_WIN32) || defined(__CC_ARM) || defined(__ARMCC__) || (__has_declspec_attribute(dllimport) && __has_declspec_attribute(dllexport))
Darin Adler
Comment 6 2017-11-20 17:08:03 PST
(In reply to Don Olmstead from comment #5) > Would you prefer it to do > > #ifndef __has_declspec_attribute > #define __has_declspec_attribute(x) 0 > #endif > > then use it like > > #elif defined(WIN32) || defined(_WIN32) || defined(__CC_ARM) || > defined(__ARMCC__) || (__has_declspec_attribute(dllimport) && > __has_declspec_attribute(dllexport)) I do think that’s slightly better.
Don Olmstead
Comment 7 2017-11-20 17:18:21 PST
Created attachment 327379 [details] Patch Addressing feedback
WebKit Commit Bot
Comment 8 2017-11-20 18:49:39 PST
Comment on attachment 327379 [details] Patch Clearing flags on attachment: 327379 Committed r225064: <https://trac.webkit.org/changeset/225064>
WebKit Commit Bot
Comment 9 2017-11-20 18:49:40 PST
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 10 2017-11-20 18:50:25 PST
Note You need to log in before you can comment on or make changes to this bug.