Fix mingw 3.3.1/3.3.3 bustage.

Follow MSVC as much as possible by requiring proper dllimport/dllexport declarations.
Remove dllimport/dllexport declarations from all nsXPTCStubBase functions and just export the class itself.
Bug #226609 r=shaver/swalker sr=dbaron a=chofmann
This commit is contained in:
cls%seawood.org 2004-03-16 08:07:25 +00:00
Родитель caec22bc62
Коммит e887c496ee
12 изменённых файлов: 544 добавлений и 522 удалений

Просмотреть файл

@ -516,7 +516,7 @@ endif
ifeq ($(OS_ARCH),WINNT)
ifdef GNU_CC
ifndef IS_COMPONENT
DSO_LDOPTS += -Wl,--export-all-symbols -Wl,--out-implib -Wl,$(IMPORT_LIBRARY) -Wl,-enable-runtime-pseudo-reloc
DSO_LDOPTS += -Wl,--out-implib -Wl,$(IMPORT_LIBRARY)
endif
endif
endif

Просмотреть файл

@ -68,7 +68,7 @@ public:
virtual PRInt32 HandleLine(char *line, PRUint32 line_length) = 0;
};
class NS_MSG_BASE nsMsgLineBuffer : public nsByteArray
class NS_MSG_BASE nsMsgLineBuffer : public nsMsgLineBufferHandler
{
public:
nsMsgLineBuffer(nsMsgLineBufferHandler *handler, PRBool convertNewlinesP);

Просмотреть файл

@ -159,7 +159,7 @@ inline int nsParseMailMessageState::msg_UnHex(char C)
}
// This class is part of the mailbox parsing state machine
class nsMsgMailboxParser : public nsIStreamListener, public nsParseMailMessageState, public nsMsgLineBuffer, public nsMsgLineBufferHandler, public nsIDBChangeListener
class nsMsgMailboxParser : public nsIStreamListener, public nsParseMailMessageState, public nsMsgLineBuffer, public nsIDBChangeListener
{
public:
nsMsgMailboxParser(nsIMsgFolder *);

Просмотреть файл

@ -65,7 +65,7 @@
*
*/
class NS_COM nsDequeFunctor{
class nsDequeFunctor{
public:
virtual void* operator()(void* anObject)=0;
};

Просмотреть файл

@ -79,7 +79,7 @@ NS_GetWeakReference( nsISupports* aInstancePtr, nsresult* aErrorPtr )
return NS_STATIC_CAST(nsIWeakReference*, result);
}
NS_IMETHODIMP
NS_COM nsresult
nsSupportsWeakReference::GetWeakReference( nsIWeakReference** aInstancePtr )
{
if ( !aInstancePtr )

Просмотреть файл

@ -153,7 +153,7 @@
//========================================================================================
// Compiler-specific macros, as needed
//========================================================================================
#if !defined(NS_USING_NAMESPACE) && (defined(__MWERKS__) || defined(XP_WIN))
#if !defined(NS_USING_NAMESPACE) && (defined(__MWERKS__) || defined(_MSC_VER))
#define NS_USING_NAMESPACE
#endif

Просмотреть файл

@ -45,17 +45,17 @@
#include "prio.h"
#include "nsError.h"
#include "windows.h"
#include <windows.h>
#if (_MSC_VER == 1100)
#if (_MSC_VER == 1100) || defined(__GNUC__)
#define INITGUID
#include "objbase.h"
#include <objbase.h>
DEFINE_OLEGUID(IID_IPersistFile, 0x0000010BL, 0, 0);
#endif
#include "shlobj.h"
#include "shellapi.h"
#include "shlguid.h"
#include <shlobj.h>
#include <shellapi.h>
#include <shlguid.h>
#ifdef UNICODE
#define CreateDirectoryW CreateDirectory

Просмотреть файл

@ -118,14 +118,10 @@ class nsIFileSpec;
//========================================================================================
// Compiler-specific macros, as needed
//========================================================================================
#if !defined(NS_USING_NAMESPACE) && (defined(__MWERKS__) || defined(XP_WIN))
#if !defined(NS_USING_NAMESPACE) && (defined(__MWERKS__) || defined(_MSC_VER))
#define NS_USING_NAMESPACE
#endif
#if !defined(NS_USING_STL) && (defined(__MWERKS__) || defined(XP_WIN))
#define NS_USING_STL
#endif
#ifdef NS_USING_NAMESPACE
#define NS_NAMESPACE_PROTOTYPE
@ -680,7 +676,7 @@ protected:
//========================================================================================
class NS_COM_OBSOLETE nsIOFileStream
class nsIOFileStream
// Please read the comments at the top of this file
//========================================================================================
: public nsInputFileStream

Просмотреть файл

@ -40,11 +40,11 @@ print OUTFILE "* 2 is Release\n";
print OUTFILE "*/\n";
print OUTFILE "#if !defined(__ia64) || (!defined(__hpux) && !defined(__linux__))\n";
for($i = 0; $i < $entry_count; $i++) {
print OUTFILE "XPTC_EXPORT NS_IMETHOD Stub",$i+3,"();\n";
print OUTFILE "NS_IMETHOD Stub",$i+3,"();\n";
}
print OUTFILE "#else\n";
for($i = 0; $i < $entry_count; $i++) {
print OUTFILE "XPTC_EXPORT NS_IMETHOD Stub",$i+3,"(PRUint64,\n";
print OUTFILE "NS_IMETHOD Stub",$i+3,"(PRUint64,\n";
print OUTFILE " PRUint64,PRUint64,PRUint64,PRUint64,PRUint64,PRUint64);\n";
}
@ -53,7 +53,7 @@ print OUTFILE "#endif\n";
print OUTFILE "\n/* declarations of sentinel stubs */\n";
for($i = 0; $i < $sentinel_count; $i++) {
print OUTFILE "XPTC_EXPORT NS_IMETHOD Sentinel",$i,"();\n";
print OUTFILE "NS_IMETHOD Sentinel",$i,"();\n";
}
close(OUTFILE);

Просмотреть файл

@ -189,14 +189,14 @@ struct nsXPTCVariant : public nsXPTCMiniVariant
#undef IMETHOD_VISIBILITY
#define IMETHOD_VISIBILITY NS_VISIBILITY_DEFAULT
class nsXPTCStubBase : public nsISupports
class XPTC_EXPORT nsXPTCStubBase : public nsISupports
{
public:
// We are going to implement this to force the compiler to generate a
// vtbl for this class. Since this is overridden in the inheriting class
// we expect it to never be called.
// *This is needed by the Irix implementation.*
XPTC_EXPORT NS_IMETHOD QueryInterface(REFNSIID aIID, void** aInstancePtr);
NS_IMETHOD QueryInterface(REFNSIID aIID, void** aInstancePtr);
// Include generated vtbl stub declarations.
// These are virtual and *also* implemented by this class..

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -109,16 +109,38 @@ xptc_invoke_copy_to_stack_keeper (void)
it call non-static functions so preserving and loading the PIC register
is unnecessary. Define MOZ_PRESERVE_PIC if this changes. See mozilla
bug 140412 for details. However, avoid this if you can. It's slower.
*/
/*
* Hack for gcc for win32. Functions used externally must be
* explicitly dllexported.
* Bug 226609
*/
#ifdef XP_WIN32
extern "C" {
nsresult _XPTC_InvokeByIndex(nsISupports* that, PRUint32 methodIndex,
PRUint32 paramCount, nsXPTCVariant* params);
XPTC_PUBLIC_API(nsresult)
XPTC_InvokeByIndex(nsISupports* that, PRUint32 methodIndex,
PRUint32 paramCount, nsXPTCVariant* params) {
return _XPTC_InvokeByIndex(that, methodIndex, paramCount, params);
}
}
#endif
__asm__ (
".text\n\t"
/* alignment here seems unimportant here; this was 16, now it's 2 which
is what xptcstubs uses. */
".align 2\n\t"
#ifdef XP_WIN32
".globl " SYMBOL_UNDERSCORE "_XPTC_InvokeByIndex\n\t"
".type " SYMBOL_UNDERSCORE "_XPTC_InvokeByIndex,@function\n"
SYMBOL_UNDERSCORE "_XPTC_InvokeByIndex:\n\t"
#else
".globl " SYMBOL_UNDERSCORE "XPTC_InvokeByIndex\n\t"
".type " SYMBOL_UNDERSCORE "XPTC_InvokeByIndex,@function\n"
SYMBOL_UNDERSCORE "XPTC_InvokeByIndex:\n\t"
#endif
"pushl %ebp\n\t"
"movl %esp, %ebp\n\t"
#ifdef MOZ_PRESERVE_PIC
@ -171,7 +193,11 @@ __asm__ (
"movl %ebp, %esp\n\t"
"popl %ebp\n\t"
"ret\n"
#ifdef XP_WIN32
".size " SYMBOL_UNDERSCORE "_XPTC_InvokeByIndex, . -" SYMBOL_UNDERSCORE "_XPTC_InvokeByIndex\n\t"
#else
".size " SYMBOL_UNDERSCORE "XPTC_InvokeByIndex, . -" SYMBOL_UNDERSCORE "XPTC_InvokeByIndex\n\t"
#endif
);
#else