Fix mingw 3.3.1/3.3.3 bustage. Follow MSVC as much as possible by requiring proper dllimport/dllexport declarations.

Bug #226609 r=shaver sr=dbaron a=chofmann
This commit is contained in:
cls%seawood.org 2004-03-15 23:47:04 +00:00
Родитель cabd62878a
Коммит 8e702f20f2
10 изменённых файлов: 41 добавлений и 19 удалений

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

@ -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

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

@ -189,7 +189,7 @@ 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

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

@ -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