Fixes for Windows CE. b=418662, r=bsmedberg, a=damons

git-svn-id: svn://10.0.0.236/trunk@246329 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
dougt%meer.net
2008-02-23 00:22:48 +00:00
parent 6c04afdfa8
commit d2f5437178
10 changed files with 41 additions and 28 deletions

View File

@@ -118,7 +118,7 @@
// objects alive during the unlinking.
//
#ifndef __MINGW32__
#if !defined(__MINGW32__) && !defined(WINCE)
#ifdef WIN32
#include <crtdbg.h>
#include <errno.h>

View File

@@ -79,10 +79,6 @@ NS_MeanAndStdDev(double n, double sumOfValues, double sumOfSquaredValues,
#define NS_IMPL_REFCNT_LOGGING
#ifdef WINCE
#undef NS_IMPL_REFCNT_LOGGING
#endif
#ifdef NS_IMPL_REFCNT_LOGGING
#include "plhash.h"
#include "prmem.h"

View File

@@ -266,7 +266,7 @@ PRBool NS_IsAsciiDigit(PRUnichar aChar)
return aChar >= '0' && aChar <= '9';
}
#ifdef XP_WIN
#if defined(XP_WIN) && !defined(WINCE)
void
printf_stderr(const char *fmt, ...)
{

View File

@@ -59,7 +59,7 @@ LOCAL_INCLUDES = \
ifeq (Darwin,$(OS_ARCH))
LINKSRC = nsGlueLinkingOSX.cpp
endif
ifeq (WINNT,$(OS_ARCH))
ifneq (,$(filter WINNT WINCE,$(OS_ARCH)))
LINKSRC = nsGlueLinkingWin.cpp
endif
ifneq (,$(filter AIX DragonFly FreeBSD Linux NetBSD OpenBSD SunOS,$(OS_ARCH)))

View File

@@ -174,7 +174,7 @@ static nsresult GetWindowsFolder(int folder, nsILocalFile** aFile)
//----------------------------------------------------------------------------------------
{
WCHAR path[MAX_PATH + 2];
HRESULT result = ::SHGetSpecialFolderPathW(NULL, path, folder, true);
HRESULT result = SHGetSpecialFolderPathW(NULL, path, folder, true);
if (!SUCCEEDED(result))
return NS_ERROR_FAILURE;

View File

@@ -2869,7 +2869,9 @@ nsLocalFile::EnsureShortPath()
{
if (!mShortWorkingPath.IsEmpty())
return;
#ifdef WINCE
mShortWorkingPath.Assign(mWorkingPath);
#else
WCHAR thisshort[MAX_PATH];
DWORD thisr = ::GetShortPathNameW(mWorkingPath.get(), thisshort,
sizeof(thisshort));
@@ -2878,6 +2880,7 @@ nsLocalFile::EnsureShortPath()
mShortWorkingPath.Assign(thisshort);
else
mShortWorkingPath.Assign(mWorkingPath);
#endif
}
// nsIHashable

View File

@@ -48,9 +48,13 @@ else
ifeq ($(OS_ARCH),WINNT)
DIRS = win32
else
ifeq ($(OS_ARCH),WINCE)
DIRS = win32
else
DIRS = unix
endif
endif
endif
include $(topsrcdir)/config/rules.mk

View File

@@ -125,8 +125,9 @@ invoke_count_words(PRUint32 paramCount, nsXPTCVariant* s)
}
XPTC_PUBLIC_API(nsresult)
XPTC_InvokeByIndex(nsISupports* that, PRUint32 methodIndex, PRUint32 paramCount, nsXPTCVariant* params)
extern "C" NS_EXPORT nsresult NS_FROZENCALL
NS_InvokeByIndex_P(nsISupports* that, PRUint32 methodIndex,
PRUint32 paramCount, nsXPTCVariant* params)
{
return asmXPTC_InvokeByIndex(that,
methodIndex,

View File

@@ -36,6 +36,7 @@
/* Implement shared vtbl methods. */
#include "xptcprivate.h"
#include "xptiprivate.h"
#ifndef WIN32
#error "This code is for Win32 only"
@@ -45,13 +46,13 @@ extern "C" {
nsresult __stdcall
PrepareAndDispatch(nsXPTCStubBase* self, uint32 methodIndex, PRUint32* args)
PrepareAndDispatch(nsXPTCStubBase* self, PRUint32 methodIndex,
PRUint32* args)
{
#define PARAM_BUFFER_COUNT 16
nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
nsXPTCMiniVariant* dispatchParams = NULL;
nsIInterfaceInfo* iface_info = NULL;
const nsXPTMethodInfo* info;
PRUint8 paramCount;
PRUint8 i;
@@ -59,11 +60,8 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32 methodIndex, PRUint32* args)
NS_ASSERTION(self,"no self");
self->GetInterfaceInfo(&iface_info);
NS_ASSERTION(iface_info,"no interface info");
iface_info->GetMethodInfo(PRUint16(methodIndex), &info);
NS_ASSERTION(info,"no interface info");
self->mEntry->GetMethodInfo(PRUint16(methodIndex), &info);
NS_ASSERTION(info,"no method info");
paramCount = info->GetParamCount();
@@ -108,9 +106,7 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32 methodIndex, PRUint32* args)
}
}
result = self->CallMethod((PRUint16)methodIndex, info, dispatchParams);
NS_RELEASE(iface_info);
result = self->mOuter->CallMethod((PRUint16)methodIndex, info, dispatchParams);
if(dispatchParams != paramBuffer)
delete [] dispatchParams;
@@ -124,10 +120,19 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32 methodIndex, PRUint32* args)
// these macros get defined inside xptc_asm_ceppc.asm
// asm prototypes
#define STUB_ENTRY(n) \
nsresult __stdcall asmXPTCStubBase_Stub##n( void ); \
\
XPTC_PUBLIC_API(nsresult) \
nsresult __stdcall asmXPTCStubBase_Stub##n( void );
#define SENTINEL_ENTRY(n)
#include "xptcstubsdef.inc"
#undef STUB_ENTRY
#undef SENTINEL_ENTRY
#define STUB_ENTRY(n) \
nsresult \
__stdcall nsXPTCStubBase::Stub##n() \
{ \
return asmXPTCStubBase_Stub##n(); \
@@ -139,8 +144,7 @@ nsresult __stdcall nsXPTCStubBase::Sentinel##n() \
{ \
NS_ASSERTION(0,"nsXPTCStubBase::Sentinel called"); \
return NS_ERROR_NOT_IMPLEMENTED; \
} \
}
#include "xptcstubsdef.inc"

View File

@@ -68,6 +68,9 @@ CSRCS = \
ifdef CROSS_COMPILE
HOST_PROGRAM = host_xpidl$(HOST_BIN_SUFFIX)
HOST_CSRCS = $(CSRCS)
ifdef WINCE
HOST_LDFLAGS += -ladvapi32.lib
endif
endif
ifdef STATIC_LIBIDL
@@ -172,9 +175,11 @@ ifdef WINCE
# Compile directly against the static lib, so we can use the tools
# during the build without the shared library path being set.
HOST_CFLAGS += -DEXPORT_XPT_API
# Force MOZ_NO_DEBUG_RTL=1
HOST_CFLAGS += /MD
# HOST_CFLAGS += /MD
LDFLAGS += -NODEFAULTLIB:MSVCRT
HOST_LIBS += Advapi32.lib
HOST_CFLAGS +=-D_X86_
endif
endif