зеркало из https://github.com/mozilla/gecko-dev.git
changed windows define from XP_WIN to _WINDOWS and fixed compilation bugs
This commit is contained in:
Родитель
3dea144f37
Коммит
e1b868d4d5
|
@ -57,7 +57,7 @@
|
|||
#include "nsInstallPatch.h"
|
||||
#include "nsInstallUninstall.h"
|
||||
|
||||
#ifdef XP_WIN
|
||||
#ifdef _WINDOWS
|
||||
#include "nsWinReg.h"
|
||||
#include "nsWinProfile.h"
|
||||
#endif
|
||||
|
@ -2279,9 +2279,9 @@ nsInstall::GetLastError(PRInt32* aReturn)
|
|||
}
|
||||
|
||||
PRInt32
|
||||
nsInstall::GetWinProfile(JSContext* jscontext, JSClass* WinProfileClass, const nsString& aFolder, const nsString& aFile, jsval* aReturn)
|
||||
nsInstall::GetWinProfile(const nsString& aFolder, const nsString& aFile, JSContext* jscontext, JSClass* WinProfileClass, jsval* aReturn)
|
||||
{
|
||||
#ifdef XP_WIN
|
||||
#ifdef _WINDOWS
|
||||
JSObject* winProfileObject;
|
||||
nsWinProfile* nativeWinProfileObject = new nsWinProfile(this, aFolder, aFile);
|
||||
JSObject* winProfilePrototype = this->RetrieveWinProfilePrototype();
|
||||
|
@ -2297,7 +2297,7 @@ nsInstall::GetWinProfile(JSContext* jscontext, JSClass* WinProfileClass, const n
|
|||
*aReturn = OBJECT_TO_JSVAL(winProfileObject);
|
||||
#else
|
||||
*aReturn = JSVAL_NULL;
|
||||
#endif /* XP_WIN */
|
||||
#endif /* _WINDOWS */
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -2305,7 +2305,7 @@ nsInstall::GetWinProfile(JSContext* jscontext, JSClass* WinProfileClass, const n
|
|||
PRInt32
|
||||
nsInstall::GetWinRegistry(JSContext* jscontext, JSClass* WinRegClass, jsval* aReturn)
|
||||
{
|
||||
#ifdef XP_WIN
|
||||
#ifdef _WINDOWS
|
||||
JSObject* winRegObject;
|
||||
nsWinReg* nativeWinRegObject = new nsWinReg(this);
|
||||
JSObject* winRegPrototype = this->RetrieveWinRegPrototype();
|
||||
|
@ -2321,7 +2321,7 @@ nsInstall::GetWinRegistry(JSContext* jscontext, JSClass* WinRegClass, jsval* aRe
|
|||
*aReturn = OBJECT_TO_JSVAL(winRegObject);
|
||||
#else
|
||||
*aReturn = JSVAL_NULL;
|
||||
#endif /* XP_WIN */
|
||||
#endif /* _WINDOWS */
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
|
@ -172,7 +172,7 @@ class nsInstall
|
|||
PRInt32 GetFolder(const nsString& aTargetFolder, const nsString& aSubdirectory, nsString** aFolder);
|
||||
PRInt32 GetFolder(const nsString& aTargetFolder, nsString** aFolder);
|
||||
PRInt32 GetLastError(PRInt32* aReturn);
|
||||
PRInt32 GetWinProfile(JSContext* jscontext, JSClass* WinProfileClass, const nsString& aFolder, const nsString& aFile, jsval* aReturn);
|
||||
PRInt32 GetWinProfile(const nsString& aFolder, const nsString& aFile, JSContext* jscontext, JSClass* WinProfileClass, jsval* aReturn);
|
||||
PRInt32 GetWinRegistry(JSContext* jscontext, JSClass* WinRegClass, jsval* aReturn);
|
||||
PRInt32 Patch(const nsString& aRegName, const nsString& aVersion, const nsString& aJarSource, const nsString& aFolder, const nsString& aTargetName, PRInt32* aReturn);
|
||||
PRInt32 Patch(const nsString& aRegName, nsIDOMInstallVersion* aVersion, const nsString& aJarSource, const nsString& aFolder, const nsString& aTargetName, PRInt32* aReturn);
|
||||
|
|
|
@ -28,7 +28,10 @@
|
|||
|
||||
#include "stdio.h"
|
||||
|
||||
#ifdef XP_WIN
|
||||
#ifdef _WINDOWS
|
||||
#include "nsJSWinReg.h"
|
||||
#include "nsJSWinProfile.h"
|
||||
|
||||
extern JSClass WinRegClass;
|
||||
extern JSClass WinProfileClass;
|
||||
#endif
|
||||
|
@ -988,11 +991,13 @@ PR_STATIC_CALLBACK(JSBool)
|
|||
InstallGetWinProfile(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
|
||||
{
|
||||
nsInstall *nativeThis = (nsInstall*)JS_GetPrivate(cx, obj);
|
||||
JSBool rBool = JS_FALSE;
|
||||
JSBool rBool = JS_FALSE;
|
||||
nsAutoString b0;
|
||||
nsAutoString b1;
|
||||
|
||||
*rval = JSVAL_NULL;
|
||||
|
||||
#ifdef XP_WIN
|
||||
#ifdef _WINDOWS
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if(nsnull == nativeThis)
|
||||
{
|
||||
|
@ -1003,7 +1008,11 @@ InstallGetWinProfile(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsva
|
|||
{
|
||||
// public int GetWinProfile (Object folder,
|
||||
// String file);
|
||||
if(NS_OK != nativeThis->GetWinProfile(cx, &WinProfileClass, rval))
|
||||
|
||||
nsCvrtJSValToStr(b0, cx, argv[0]);
|
||||
nsCvrtJSValToStr(b1, cx, argv[1]);
|
||||
|
||||
if(NS_OK != nativeThis->GetWinProfile(b0, b1, cx, &WinProfileClass, rval))
|
||||
{
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
@ -1030,7 +1039,7 @@ InstallGetWinRegistry(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsv
|
|||
|
||||
*rval = JSVAL_NULL;
|
||||
|
||||
#ifdef XP_WIN
|
||||
#ifdef _WINDOWS
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if(nsnull == nativeThis)
|
||||
{
|
||||
|
@ -1536,14 +1545,14 @@ PRInt32 InitXPInstallObjects(nsIScriptContext *aContext, const char* jarfile, co
|
|||
JS_SetPrivate(jscontext, installObject, nativeInstallObject);
|
||||
nativeInstallObject->SetScriptObject(installObject);
|
||||
|
||||
#ifdef XP_WIN
|
||||
#ifdef _WINDOWS
|
||||
if(NS_OK != InitWinRegPrototype(jscontext, global, &winRegPrototype))
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
nativeInstallObject->SaveWinRegPrototype(winRegPrototype);
|
||||
|
||||
if(NS_OK != InitWinProfilePrototype(jscontext, global, &winRegPrototype)
|
||||
if(NS_OK != InitWinProfilePrototype(jscontext, global, &winRegPrototype))
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
@ -1590,14 +1599,14 @@ PRInt32 InitXPInstallObjects(JSContext *jscontext, JSObject *global, const char*
|
|||
JS_SetPrivate(jscontext, installObject, nativeInstallObject);
|
||||
nativeInstallObject->SetScriptObject(installObject);
|
||||
|
||||
#ifdef XP_WIN
|
||||
#ifdef _WINDOWS
|
||||
if(NS_OK != InitWinRegPrototype(jscontext, global, &winRegPrototype))
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
nativeInstallObject->SaveWinRegPrototype(winRegPrototype);
|
||||
|
||||
if(NS_OK != InitWinProfilePrototype(jscontext, global, &winRegPrototype)
|
||||
if(NS_OK != InitWinProfilePrototype(jscontext, global, &winRegPrototype))
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
|
|
@ -16,10 +16,10 @@
|
|||
* Reserved.
|
||||
*/
|
||||
|
||||
#ifndef __NS_JSWINREG_H__
|
||||
#define __NS_JSWINREG_H__
|
||||
#ifndef __NS_JSWINPROTOTYPE_H__
|
||||
#define __NS_JSWINPROTOTYPE_H__
|
||||
|
||||
PRInt32
|
||||
InitWinRegPrototype(JSContext *jscontext, JSObject *global, JSObject **winRegPrototype);
|
||||
InitWinProfilePrototype(JSContext *jscontext, JSObject *global, JSObject **winRegPrototype);
|
||||
|
||||
#endif
|
||||
|
|
Загрузка…
Ссылка в новой задаче