зеркало из https://github.com/mozilla/pjs.git
Fix misc build issues for mingw gcc 3.3.1:
* Link non-component libs using -Wl,-enable-runtime-psuedo-relocs to workaround auto-import issues * the last element of an enum cannot end with a comma * PRUint16 is not interchangable with PRUnichar nor WCHAR * cannot take the address of or call ::main() from another c++ function * Functions declared within |class foo {};| block do not need extra |foo::| qualification * GCC no longer implements <varargs.h>. Use <stdarg.h> instead Bug #217009 sr=dbaron
This commit is contained in:
Родитель
854e18e642
Коммит
bfca537521
|
@ -521,7 +521,7 @@ endif
|
||||||
ifeq ($(OS_ARCH),WINNT)
|
ifeq ($(OS_ARCH),WINNT)
|
||||||
ifdef GNU_CC
|
ifdef GNU_CC
|
||||||
ifndef IS_COMPONENT
|
ifndef IS_COMPONENT
|
||||||
DSO_LDOPTS += -Wl,--export-all-symbols -Wl,--out-implib -Wl,$(IMPORT_LIBRARY)
|
DSO_LDOPTS += -Wl,--export-all-symbols -Wl,--out-implib -Wl,$(IMPORT_LIBRARY) -Wl,-enable-runtime-pseudo-reloc
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
|
@ -309,7 +309,7 @@ ChangeCase(JSContext *cx, JSString *src, jsval *rval,
|
||||||
nsAutoString result;
|
nsAutoString result;
|
||||||
changeCaseFnc(str, result);
|
changeCaseFnc(str, result);
|
||||||
|
|
||||||
JSString *ucstr = JS_NewUCStringCopyN(cx, result.get(), result.Length());
|
JSString *ucstr = JS_NewUCStringCopyN(cx, (jschar*)result.get(), result.Length());
|
||||||
if (!ucstr) {
|
if (!ucstr) {
|
||||||
return JS_FALSE;
|
return JS_FALSE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1476,7 +1476,7 @@ enum {
|
||||||
eTTFormat6TrimmedTableMapping = 6,
|
eTTFormat6TrimmedTableMapping = 6,
|
||||||
eTTFormat8Mixed16bitAnd32bitCoverage = 8,
|
eTTFormat8Mixed16bitAnd32bitCoverage = 8,
|
||||||
eTTFormat10TrimmedArray = 10,
|
eTTFormat10TrimmedArray = 10,
|
||||||
eTTFormat12SegmentedCoverage = 12,
|
eTTFormat12SegmentedCoverage = 12
|
||||||
};
|
};
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -1939,7 +1939,7 @@ GetGlyphIndices(HDC aDC,
|
||||||
PRUint16* idDelta = startCode + segCount;
|
PRUint16* idDelta = startCode + segCount;
|
||||||
PRUint16* idRangeOffset = idDelta + segCount;
|
PRUint16* idRangeOffset = idDelta + segCount;
|
||||||
|
|
||||||
PRUint16* result = aResult.GetArray(aLength);
|
PRUnichar* result = aResult.GetArray(aLength);
|
||||||
if (!result) {
|
if (!result) {
|
||||||
return NS_ERROR_OUT_OF_MEMORY;
|
return NS_ERROR_OUT_OF_MEMORY;
|
||||||
}
|
}
|
||||||
|
@ -4255,7 +4255,7 @@ nsFontWinNonUnicode::GetBoundingMetrics(HDC aDC,
|
||||||
if (gGlyphAgent.GetState() != eGlyphAgent_UNICODE) {
|
if (gGlyphAgent.GetState() != eGlyphAgent_UNICODE) {
|
||||||
// we are on a platform that doesn't implement GetGlyphOutlineW()
|
// we are on a platform that doesn't implement GetGlyphOutlineW()
|
||||||
// we need to use glyph indices
|
// we need to use glyph indices
|
||||||
rv = GetGlyphIndices(aDC, &mCMAP, (PRUint16*) buffer.GetArray(), destLength / 2, buf);
|
rv = GetGlyphIndices(aDC, &mCMAP, (PRUnichar*)buffer.GetArray(), destLength / 2, buf);
|
||||||
if (NS_FAILED(rv)) {
|
if (NS_FAILED(rv)) {
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
@ -4263,7 +4263,7 @@ nsFontWinNonUnicode::GetBoundingMetrics(HDC aDC,
|
||||||
|
|
||||||
// buffer.mBuffer is now a pseudo-Unicode string so that we can use
|
// buffer.mBuffer is now a pseudo-Unicode string so that we can use
|
||||||
// GetBoundingMetricsCommon() also used by nsFontWinUnicode.
|
// GetBoundingMetricsCommon() also used by nsFontWinUnicode.
|
||||||
return GetBoundingMetricsCommon(aDC, mOverhangCorrection, (PRUint16*) buffer.GetArray(),
|
return GetBoundingMetricsCommon(aDC, mOverhangCorrection, (PRUnichar*)buffer.GetArray(),
|
||||||
destLength / 2, aBoundingMetrics, buf.GetArray());
|
destLength / 2, aBoundingMetrics, buf.GetArray());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -4437,7 +4437,7 @@ GenerateSingleByte(nsCharsetInfo* aSelf)
|
||||||
{
|
{
|
||||||
PRUint32 map[UCS2_MAP_LEN];
|
PRUint32 map[UCS2_MAP_LEN];
|
||||||
PRUint8 mb[256];
|
PRUint8 mb[256];
|
||||||
PRUint16 wc[256];
|
WCHAR wc[256];
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
memset(map, 0, sizeof(map));
|
memset(map, 0, sizeof(map));
|
||||||
|
@ -4485,7 +4485,7 @@ GenerateMultiByte(nsCharsetInfo* aSelf)
|
||||||
{
|
{
|
||||||
PRUint32 map[UCS2_MAP_LEN];
|
PRUint32 map[UCS2_MAP_LEN];
|
||||||
memset(map, 0, sizeof(map));
|
memset(map, 0, sizeof(map));
|
||||||
for (PRUint16 c = 0; c < 0xFFFF; ++c) {
|
for (WCHAR c = 0; c < 0xFFFF; ++c) {
|
||||||
BOOL defaulted = FALSE;
|
BOOL defaulted = FALSE;
|
||||||
WideCharToMultiByte(aSelf->mCodePage, 0, &c, 1, nsnull, 0, nsnull,
|
WideCharToMultiByte(aSelf->mCodePage, 0, &c, 1, nsnull, 0, nsnull,
|
||||||
&defaulted);
|
&defaulted);
|
||||||
|
@ -4499,7 +4499,7 @@ GenerateMultiByte(nsCharsetInfo* aSelf)
|
||||||
static int
|
static int
|
||||||
HaveConverterFor(PRUint8 aCharset)
|
HaveConverterFor(PRUint8 aCharset)
|
||||||
{
|
{
|
||||||
PRUint16 wc = 'a';
|
WCHAR wc = 'a';
|
||||||
char mb[8];
|
char mb[8];
|
||||||
if (WideCharToMultiByte(gCharsetInfo[gCharsetToIndex[aCharset]].mCodePage, 0,
|
if (WideCharToMultiByte(gCharsetInfo[gCharsetToIndex[aCharset]].mCodePage, 0,
|
||||||
&wc, 1, mb, sizeof(mb), nsnull, nsnull)) {
|
&wc, 1, mb, sizeof(mb), nsnull, nsnull)) {
|
||||||
|
|
|
@ -44,7 +44,7 @@
|
||||||
enum eFontType {
|
enum eFontType {
|
||||||
eFontType_UNKNOWN = -1,
|
eFontType_UNKNOWN = -1,
|
||||||
eFontType_Unicode,
|
eFontType_Unicode,
|
||||||
eFontType_NonUnicode,
|
eFontType_NonUnicode
|
||||||
};
|
};
|
||||||
|
|
||||||
struct nsCharacterMap {
|
struct nsCharacterMap {
|
||||||
|
|
|
@ -454,7 +454,7 @@ nsMessengerWinIntegration::Init()
|
||||||
// get application path
|
// get application path
|
||||||
char appPath[_MAX_PATH] = {0};
|
char appPath[_MAX_PATH] = {0};
|
||||||
GetModuleFileName(nsnull, appPath, sizeof(appPath));
|
GetModuleFileName(nsnull, appPath, sizeof(appPath));
|
||||||
WORD wideFormatAppPath[_MAX_PATH*2] = {0};
|
WCHAR wideFormatAppPath[_MAX_PATH*2] = {0};
|
||||||
MultiByteToWideChar(CP_ACP, 0, appPath, strlen(appPath), wideFormatAppPath, _MAX_PATH*2);
|
MultiByteToWideChar(CP_ACP, 0, appPath, strlen(appPath), wideFormatAppPath, _MAX_PATH*2);
|
||||||
mAppName.Assign((PRUnichar *)wideFormatAppPath);
|
mAppName.Assign((PRUnichar *)wideFormatAppPath);
|
||||||
|
|
||||||
|
|
|
@ -167,8 +167,8 @@ private:
|
||||||
static tRASGETAUTODIALENABLE mpRasGetAutodialEnable;
|
static tRASGETAUTODIALENABLE mpRasGetAutodialEnable;
|
||||||
static tRASGETAUTODIALPARAM mpRasGetAutodialParam;
|
static tRASGETAUTODIALPARAM mpRasGetAutodialParam;
|
||||||
|
|
||||||
PRBool nsRASAutodial::LoadRASapi32DLL();
|
PRBool LoadRASapi32DLL();
|
||||||
PRBool nsRASAutodial::LoadRASdlgDLL();
|
PRBool LoadRASdlgDLL();
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -318,11 +318,11 @@ nsHttpNTLMAuth::GenerateCredentials(nsIHttpChannel *httpChannel,
|
||||||
pIdent = &identA;
|
pIdent = &identA;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
identW.User = (PRUnichar *) user;
|
identW.User = (unsigned short *) user;
|
||||||
identW.UserLength = nsCRT::strlen(user);
|
identW.UserLength = nsCRT::strlen(user);
|
||||||
identW.Domain = (PRUnichar *) domain;
|
identW.Domain = (unsigned short *) domain;
|
||||||
identW.DomainLength = nsCRT::strlen(domain);
|
identW.DomainLength = nsCRT::strlen(domain);
|
||||||
identW.Password = (PRUnichar *) pass;
|
identW.Password = (unsigned short *) pass;
|
||||||
identW.PasswordLength = nsCRT::strlen(pass);
|
identW.PasswordLength = nsCRT::strlen(pass);
|
||||||
identW.Flags = SEC_WINNT_AUTH_IDENTITY_UNICODE;
|
identW.Flags = SEC_WINNT_AUTH_IDENTITY_UNICODE;
|
||||||
pIdent = &identW;
|
pIdent = &identW;
|
||||||
|
|
|
@ -41,7 +41,7 @@
|
||||||
#define LOG(args) PR_LOG(mLog, PR_LOG_DEBUG, args)
|
#define LOG(args) PR_LOG(mLog, PR_LOG_DEBUG, args)
|
||||||
|
|
||||||
// helper methods: forward declarations...
|
// helper methods: forward declarations...
|
||||||
BYTE * GetValueBytes( HKEY hKey, const char *pValueName, DWORD *pLen=0);
|
static BYTE * GetValueBytes( HKEY hKey, const char *pValueName, DWORD *pLen=0);
|
||||||
nsresult GetExtensionFrom4xRegistryInfo(const char * aMimeType, nsCString& aFileExtension);
|
nsresult GetExtensionFrom4xRegistryInfo(const char * aMimeType, nsCString& aFileExtension);
|
||||||
nsresult GetExtensionFromWindowsMimeDatabase(const char * aMimeType, nsCString& aFileExtension);
|
nsresult GetExtensionFromWindowsMimeDatabase(const char * aMimeType, nsCString& aFileExtension);
|
||||||
|
|
||||||
|
|
|
@ -160,6 +160,7 @@ int main(int argc, char **argv)
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef __GNUC__
|
||||||
int PASCAL
|
int PASCAL
|
||||||
WinMain(HINSTANCE instance, HINSTANCE prevInstance, LPSTR cmdParam,
|
WinMain(HINSTANCE instance, HINSTANCE prevInstance, LPSTR cmdParam,
|
||||||
int nCmdShow)
|
int nCmdShow)
|
||||||
|
@ -168,3 +169,4 @@ WinMain(HINSTANCE instance, HINSTANCE prevInstance, LPSTR cmdParam,
|
||||||
gPrevInstance = prevInstance;
|
gPrevInstance = prevInstance;
|
||||||
return main(0, nsnull);
|
return main(0, nsnull);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
|
@ -6598,7 +6598,8 @@ nsWindow::HandleMouseActionOfIME(int aAction, POINT *ptPos)
|
||||||
|
|
||||||
// Note: hitText has been done, so no check of mIMECompCharPos
|
// Note: hitText has been done, so no check of mIMECompCharPos
|
||||||
// and composing char maximum limit is necessary.
|
// and composing char maximum limit is necessary.
|
||||||
for (PRInt32 i = 0; i < mIMECompUnicode->Length(); i++) {
|
PRInt32 i = 0;
|
||||||
|
for (i = 0; i < mIMECompUnicode->Length(); i++) {
|
||||||
if (PT_IN_RECT(*ptPos, mIMECompCharPos[i]))
|
if (PT_IN_RECT(*ptPos, mIMECompCharPos[i]))
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1680,7 +1680,7 @@ int main(int argc, char* argv[])
|
||||||
return TranslateReturnValue(mainResult);
|
return TranslateReturnValue(mainResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined( XP_WIN ) && defined( WIN32 )
|
#if defined( XP_WIN ) && defined( WIN32 ) && !defined(__GNUC__)
|
||||||
// We need WinMain in order to not be a console app. This function is
|
// We need WinMain in order to not be a console app. This function is
|
||||||
// unused if we are a console application.
|
// unused if we are a console application.
|
||||||
int WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR args, int)
|
int WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR args, int)
|
||||||
|
|
|
@ -1062,7 +1062,7 @@ nsNativeAppSupportWin::Start( PRBool *aResult ) {
|
||||||
PRBool
|
PRBool
|
||||||
nsNativeAppSupportWin::InitTopicStrings() {
|
nsNativeAppSupportWin::InitTopicStrings() {
|
||||||
for ( int i = 0; i < topicCount; i++ ) {
|
for ( int i = 0; i < topicCount; i++ ) {
|
||||||
if ( !( mTopics[ i ] = DdeCreateStringHandle( mInstance, topicNames[ i ], CP_WINANSI ) ) ) {
|
if ( !( mTopics[ i ] = DdeCreateStringHandle( mInstance, NS_CONST_CAST(char *,topicNames[ i ]), CP_WINANSI ) ) ) {
|
||||||
return PR_FALSE;
|
return PR_FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -891,8 +891,8 @@ nsGlobalHistory::SwapBytes(const PRUnichar *source, PRUnichar *dest,
|
||||||
PRInt32 aLen)
|
PRInt32 aLen)
|
||||||
{
|
{
|
||||||
PRUint16 c;
|
PRUint16 c;
|
||||||
const PRUint16 *inp;
|
const PRUnichar *inp;
|
||||||
PRUint16 *outp;
|
PRUnichar *outp;
|
||||||
PRInt32 i;
|
PRInt32 i;
|
||||||
|
|
||||||
inp = source;
|
inp = source;
|
||||||
|
|
|
@ -1256,7 +1256,7 @@ nsInstall::LoadResources(JSContext* cx, const nsString& aBaseName, jsval* aRetur
|
||||||
JSString* propValJSStr = JS_NewUCStringCopyZ(cx, NS_REINTERPRET_CAST(const jschar*, pVal.get()));
|
JSString* propValJSStr = JS_NewUCStringCopyZ(cx, NS_REINTERPRET_CAST(const jschar*, pVal.get()));
|
||||||
jsval propValJSVal = STRING_TO_JSVAL(propValJSStr);
|
jsval propValJSVal = STRING_TO_JSVAL(propValJSStr);
|
||||||
nsString UCKey = NS_ConvertUTF8toUCS2(pKey);
|
nsString UCKey = NS_ConvertUTF8toUCS2(pKey);
|
||||||
JS_SetUCProperty(cx, res, UCKey.get(), UCKey.Length(), &propValJSVal);
|
JS_SetUCProperty(cx, res, (jschar*)UCKey.get(), UCKey.Length(), &propValJSVal);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,7 @@
|
||||||
#include "nsAppDirectoryServiceDefs.h"
|
#include "nsAppDirectoryServiceDefs.h"
|
||||||
|
|
||||||
#ifdef XP_WIN
|
#ifdef XP_WIN
|
||||||
#include <varargs.h>
|
#include <stdarg.h>
|
||||||
#include <winbase.h>
|
#include <winbase.h>
|
||||||
#include <winreg.h>
|
#include <winreg.h>
|
||||||
#endif
|
#endif
|
||||||
|
@ -401,7 +401,7 @@ nsInstallFolder::SetDirectoryPath(const nsAString& aFolderID, const nsString& aR
|
||||||
BYTE path[_MAX_PATH + 1] = { 0 };
|
BYTE path[_MAX_PATH + 1] = { 0 };
|
||||||
DWORD type;
|
DWORD type;
|
||||||
DWORD pathlen = sizeof(path);
|
DWORD pathlen = sizeof(path);
|
||||||
char *value = (dirID==WIN_PROGRAM_FILES) ?
|
const char *value = (dirID==WIN_PROGRAM_FILES) ?
|
||||||
"ProgramFilesDir" :
|
"ProgramFilesDir" :
|
||||||
"CommonFilesDir";
|
"CommonFilesDir";
|
||||||
result = RegQueryValueEx( key, value, 0, &type, path, &pathlen );
|
result = RegQueryValueEx( key, value, 0, &type, path, &pathlen );
|
||||||
|
|
Загрузка…
Ссылка в новой задаче