Closed
Bug 550401
Opened 15 years ago
Closed 15 years ago
warning C4273: 'moz_strdup' : inconsistent dll linkage (string.h relating to mozalloc.h)
Categories
(Core :: XPCOM, defect)
Tracking
()
VERIFIED
FIXED
mozilla1.9.3a5
People
(Reporter: Callek, Assigned: cjones)
References
Details
(Whiteboard: [build_warning])
Attachments
(1 file, 1 obsolete file)
4.44 KB,
patch
|
benjamin
:
review+
|
Details | Diff | Splinter Review |
C:\Program Files\Microsoft Visual Studio 8\VC\INCLUDE\string.h(207) : warning C4273: 'moz_strdup' : inconsistent dll linkage
c:\programming\objectdirs\mozilla\trunk\suiterunnerdebug\mozilla\dist\include\mozilla/mozalloc.h(138) : see previous definition of 'moz_strdup'
Per IRC with cjones, the issue is that the MSVC headers declare strdup as dllimport and we are dllexport.
Assignee | ||
Comment 1•15 years ago
|
||
Since this code has been working with dllexport, I would assume that MSVC treats undefined dllexport functions as dllimport at link time, which makes me question the usefulness of dllimport. But that's neither here nor there.
roughly you need a macro which results in DLL_EXPORT when used by mozalloc.cpp but DLL_IMPORT when included everywhere else. we have loads of macros for this.
Comment 4•15 years ago
|
||
Comment on attachment 430584 [details] [diff] [review]
proposal
+# ifdef MOZALLOC_DONT_DEFINE_MACRO_WRAPPERS
+# define MOZALLOC_METHOD __declspec(dllexport)
+# else
+# define MOZALLOC_METHOD __declspec(dllexport)
+# endif
Pretty sure you meant one of this to be dllimport?
Attachment #430584 -
Flags: review?(benjamin) → review-
Will that actually work with the system headers? Along with that fix you might need to wrap the system headers like the WinCE build does (see build/wince/shunt, iirc), to do things like
#define strdup orig_strdup
#include <sdk_dir/string.h>
#undef strdup
Assignee | ||
Comment 7•15 years ago
|
||
wfm on windows and linux.
Assignee: timeless → jones.chris.g
Attachment #435804 -
Flags: review?(benjamin)
Assignee | ||
Comment 8•15 years ago
|
||
bsmedberg, any chance of getting a quick review on this soonish? Windows devs seem to be waiting with bated breath.
Updated•15 years ago
|
Attachment #435804 -
Flags: review?(benjamin) → review+
Assignee | ||
Comment 9•15 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Updated•15 years ago
|
Attachment #430584 -
Attachment is obsolete: true
Comment 10•15 years ago
|
||
V.Fixed, per tinderbox.
(See bug 558163, just in case.)
Status: RESOLVED → VERIFIED
Flags: in-testsuite-
Target Milestone: --- → mozilla1.9.3a5
Updated•15 years ago
|
Whiteboard: [build_warning]
You need to log in
before you can comment on or make changes to this bug.
Description
•