WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
VERIFIED REMIND
77042
JSStringRefCF.cpp does not honor USE(CF) flag
https://bugs.webkit.org/show_bug.cgi?id=77042
Summary
JSStringRefCF.cpp does not honor USE(CF) flag
Brian Barnes
Reported
2012-01-25 13:16:49 PST
api/JSStringRefCF.cpp will fail to compile if the USE(CF) flag is not set. These functions are required as they are external functions, so I suggest: JSStringRef JSStringCreateWithCFString(CFStringRef string) { #if !USE(CF) return(NULL); #else // original code goes here! #endif } CFStringRef JSStringCopyCFString(CFAllocatorRef alloc, JSStringRef string) { #if !USE(CF) return(NULL); #else // original code goes here! #endif }
Attachments
Add attachment
proposed patch, testcase, etc.
Alexey Proskuryakov
Comment 1
2012-01-25 23:51:26 PST
This file should not be compiled on platforms that don't use CF. If there is a link failure because these functions are exported, the right solution is to stop exporting them on these platforms.
Brian Barnes
Comment 2
2012-01-26 06:09:34 PST
(In reply to
comment #1
)
> This file should not be compiled on platforms that don't use CF. > > If there is a link failure because these functions are exported, the right >solution is to stop exporting them on these platforms.
The problem is that this is a platform that uses CF -- win32 (wincairo). My goal is to be able to create a minimum build on win32 for embedding JSC in other apps (eventually a minimum configuration in the msvc project.) This solves one of the problems with building that version. Changing it to not compile/export would be a difficult task and rock the boat too much for a win32 build. This small fix allows you to build a non-CF (wincairo) build.
Adam Roben (:aroben)
Comment 3
2012-01-26 08:10:17 PST
I guess Alexey is right. Creating a build of JavaScriptCore that doesn't use CF or CFLite will require creating a different project configuration anyway, since we need to change the flags we pass to the linker. And it's not too hard to exclude particular files from being compiled in certain configurations. So that's probably the direction we should go with this.
Brian Barnes
Comment 4
2012-01-26 08:14:48 PST
Thanks -- I've got no problem with that as a solution; I wanted to offer the path of least resistance because I know my request to build a minimal build isn't exactly a high priority type of thing. If it's easier for you guys/gals, go for it! JSC is great for embedding and the easier and smaller it can get, the better!
Alexey Proskuryakov
Comment 5
2012-01-26 09:12:56 PST
Generally, the WebKit project is less concerned with "rocking the boat" as it is concerned with communicating intentions between people working on the code. An implemented and exported API function that doesn't do what it promises to do would be extremely confusing. So would be a !USE(CF) branch in a function that even has CF in its name.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug