RESOLVED FIXED 108745
WTF shouldn't use a script build phase to detect the presence of headers when the compiler can do it for us
https://bugs.webkit.org/show_bug.cgi?id=108745
Summary WTF shouldn't use a script build phase to detect the presence of headers when...
Mark Rowe (bdash)
Reported 2013-02-01 23:44:48 PST
WTF has a build phase to detect the presence of certain headers at build time. This is unnecessary now that the Mac port always builds with Clang, which has the __has_include directive that can detect headers for us.
Attachments
Patch v1 (7.55 KB, patch)
2013-02-01 23:53 PST, Mark Rowe (bdash)
eflews.bot: commit-queue-
Patch v2 (7.64 KB, patch)
2013-02-02 00:51 PST, Mark Rowe (bdash)
no flags
Mark Rowe (bdash)
Comment 1 2013-02-01 23:53:38 PST
Created attachment 186216 [details] Patch v1
WebKit Review Bot
Comment 2 2013-02-01 23:56:05 PST
Attachment 186216 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/JavaScriptCore/ChangeLog', u'Source/JavaScriptCore/DerivedSources.make', u'Source/WTF/ChangeLog', u'Source/WTF/WTF.xcodeproj/project.pbxproj', u'Source/WTF/wtf/FastMalloc.cpp']" exit_code: 1 Source/WTF/wtf/FastMalloc.cpp:451: Missing spaces around / [whitespace/operators] [3] Total errors found: 1 in 3 files If any of these errors are false positives, please file a bug against check-webkit-style.
Mark Rowe (bdash)
Comment 3 2013-02-02 00:18:06 PST
Comment on attachment 186216 [details] Patch v1 Clearing flags since this appears to not build with GCC.
EFL EWS Bot
Comment 4 2013-02-02 00:20:42 PST
Mark Rowe (bdash)
Comment 5 2013-02-02 00:51:39 PST
Created attachment 186220 [details] Patch v2 Split the detection of __has_include out from the use of it so that compilers that don't support it don't choke.
WebKit Review Bot
Comment 6 2013-02-02 00:58:41 PST
Attachment 186220 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/JavaScriptCore/ChangeLog', u'Source/JavaScriptCore/DerivedSources.make', u'Source/WTF/ChangeLog', u'Source/WTF/WTF.xcodeproj/project.pbxproj', u'Source/WTF/wtf/FastMalloc.cpp']" exit_code: 1 Source/WTF/wtf/FastMalloc.cpp:452: Missing spaces around / [whitespace/operators] [3] Total errors found: 1 in 3 files If any of these errors are false positives, please file a bug against check-webkit-style.
Alexey Proskuryakov
Comment 7 2013-02-02 11:47:19 PST
Comment on attachment 186220 [details] Patch v2 View in context: https://bugs.webkit.org/attachment.cgi?id=186220&action=review > Source/WTF/wtf/FastMalloc.cpp:451 > +#ifdef __has_include Would it make sense to have a WTF macro for this (like HAVE(HAS_INCLUDE))?
WebKit Review Bot
Comment 8 2013-02-02 12:27:27 PST
Comment on attachment 186220 [details] Patch v2 Clearing flags on attachment: 186220 Committed r141700: <http://trac.webkit.org/changeset/141700>
WebKit Review Bot
Comment 9 2013-02-02 12:27:30 PST
All reviewed patches have been landed. Closing bug.
Mark Rowe (bdash)
Comment 10 2013-02-02 13:07:10 PST
(In reply to comment #7) > (From update of attachment 186220 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=186220&action=review > > > Source/WTF/wtf/FastMalloc.cpp:451 > > +#ifdef __has_include > > Would it make sense to have a WTF macro for this (like HAVE(HAS_INCLUDE))? I considered doing something like COMPILER_SUPPORTS(HEADER_DETECTION). In order to make it worth it you'd want to wrap the actual use of __has_include in a macro like HAS_INCLUDE to support compilers with different names for the functionality. Sadly Clang currently seems to crash if you try to use __has_include in the body of a preprocessor macro.
Note You need to log in before you can comment on or make changes to this bug.