Bug 6403 - Windows patch: KJS_EXPORT for building DLLs
Summary: Windows patch: KJS_EXPORT for building DLLs
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 420+
Hardware: PC Windows XP
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on: 6416
Blocks: 7383
  Show dependency treegraph
 
Reported: 2006-01-06 17:37 PST by Justin Haygood
Modified: 2007-09-30 11:16 PDT (History)
3 users (show)

See Also:


Attachments
adds KJS_EXPORT to needed references (20.99 KB, patch)
2006-01-06 17:38 PST, Justin Haygood
no flags Details | Formatted Diff | Diff
Defines KJS_EXPORT (1.03 KB, patch)
2006-01-06 17:40 PST, Justin Haygood
no flags Details | Formatted Diff | Diff
KJS_EXPORT (15.79 KB, patch)
2006-01-16 14:16 PST, Justin Haygood
darin: review-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Justin Haygood 2006-01-06 17:37:38 PST
Changes from KJS to allow building a DLL that programs can link against.

Separated into 2 patches:

* One to add KJS_EXPORT
* Second to define KJS_EXPORT
Comment 1 Justin Haygood 2006-01-06 17:38:39 PST
Created attachment 5519 [details]
adds KJS_EXPORT to needed references

References located by attempting to link testkjs.exe to JavaScriptCore.dll and
adding KJS_EXPORT to things it says it needs to link to.
Comment 2 Justin Haygood 2006-01-06 17:40:29 PST
Created attachment 5520 [details]
Defines KJS_EXPORT 

I added this to fastmalloc.h because its really low level.

If there is a lower level header which is included by all headers, i can move
it there.
Comment 3 Dave Hyatt 2006-01-06 17:46:56 PST
Not sure, but maybe config.h would be more appropriate?
Comment 4 Justin Haygood 2006-01-06 17:51:15 PST
(In reply to comment #3)
> Not sure, but maybe config.h would be more appropriate?
> 

Is it included by all headers?
Comment 5 Maks Orlovich 2006-01-06 19:27:03 PST
Please consider marking the whole classes for export.  
http://www.cs.cornell.edu/~maksim/export.diff 
should be a good starting point 
 
 
Comment 6 Justin Haygood 2006-01-07 12:59:53 PST
Making this bug depend on Bug 6414 so that we can move KJS_EXPORT definition to
config.

Also, that diff is a good starting point.

Which classes should have the whole class exported?

JSObject & Interpreter are the biggest 2 that come to mind
Comment 7 Justin Haygood 2006-01-07 13:00:59 PST
Er, 6416
Comment 8 Justin Haygood 2006-01-16 14:16:30 PST
Created attachment 5726 [details]
KJS_EXPORT 

* Defines KJS_EXPORT in config.h (Requires JAVASCRIPTCORE_EXPORTS is defined by
the compiler if using Windows)
* If KJS_EXPORT isn't defined, it defines it to blank
* Exports the same classes KJS does
* Fixes a spelling error in one of the headers (error fixed in KJS's export
diff)
* Includes "nodes.h" in headers that require it (don't know why it didn't have
an error before now)
* On Windows only, makes sure the JSValue private declarations used only to
create a compiler error aren't there.. Exported classes require definitions.
Comment 9 Darin Adler 2006-01-22 12:04:05 PST
Comment on attachment 5726 [details]
KJS_EXPORT 

I don't think we want a FIXME in config.h for the possible future use of KJS_EXPORT for GCC visibility control; lets remove that for now.

The JSValue stuff should not be in an #if !WIN32 ifdef, because we do want those undefined copy constructor and assignment operators on Windows. Better would be to actually define them in value.cpp, but only when we are building a DLL on Windows. I don't think that WIN32 alone is good enough to indicate "building a DLL". For example, I know we might want to build a static library for Windows rather than a DLL, so we don't want ifdefs that assume "WIN32 == DLL".

Setting review- just because of the the value.h thing -- otherwise looks great, and about ready to land.
Comment 10 Eric Seidel (no email) 2007-09-30 11:16:42 PDT
This bug hasn't been touched in nearly a year, and since then a working Windows port has been released.  I believe we can close this now.