зеркало из https://github.com/mozilla/pjs.git
Bug 508905 - /Zc:wchar_t- is no longer required (wince part) r=doug.turner
--HG-- extra : rebase_source : 13d6dadb676ca5e29b7e7bcfff5bbb1c964f78e4
This commit is contained in:
Родитель
c2eeb271dd
Коммит
2a0ed36a96
|
@ -159,8 +159,8 @@ getenv(const char* name)
|
||||||
}
|
}
|
||||||
|
|
||||||
char
|
char
|
||||||
GetEnvironmentVariableW(const unsigned short* lpName,
|
GetEnvironmentVariableW(const WCHAR* lpName,
|
||||||
unsigned short* lpBuffer,
|
WCHAR* lpBuffer,
|
||||||
unsigned long nSize)
|
unsigned long nSize)
|
||||||
{
|
{
|
||||||
char key[256];
|
char key[256];
|
||||||
|
@ -180,8 +180,8 @@ GetEnvironmentVariableW(const unsigned short* lpName,
|
||||||
}
|
}
|
||||||
|
|
||||||
char
|
char
|
||||||
SetEnvironmentVariableW(const unsigned short* name,
|
SetEnvironmentVariableW(const WCHAR* name,
|
||||||
const unsigned short* value)
|
const WCHAR* value)
|
||||||
{
|
{
|
||||||
char key[256];
|
char key[256];
|
||||||
char val[256];
|
char val[256];
|
||||||
|
@ -204,8 +204,8 @@ SetEnvironmentVariableW(const unsigned short* name,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
unsigned int ExpandEnvironmentStringsW(const unsigned short* lpSrc,
|
unsigned int ExpandEnvironmentStringsW(const WCHAR* lpSrc,
|
||||||
unsigned short* lpDst,
|
WCHAR* lpDst,
|
||||||
unsigned int nSize)
|
unsigned int nSize)
|
||||||
{
|
{
|
||||||
if ( NULL == lpDst )
|
if ( NULL == lpDst )
|
||||||
|
@ -215,8 +215,8 @@ unsigned int ExpandEnvironmentStringsW(const unsigned short* lpSrc,
|
||||||
unsigned int index = 0;
|
unsigned int index = 0;
|
||||||
unsigned int origLen = wcslen(lpSrc);
|
unsigned int origLen = wcslen(lpSrc);
|
||||||
|
|
||||||
const unsigned short *pIn = lpSrc;
|
const WCHAR *pIn = lpSrc;
|
||||||
unsigned short *pOut = lpDst;
|
WCHAR *pOut = lpDst;
|
||||||
|
|
||||||
while ( index < origLen ) {
|
while ( index < origLen ) {
|
||||||
|
|
||||||
|
@ -228,7 +228,7 @@ unsigned int ExpandEnvironmentStringsW(const unsigned short* lpSrc,
|
||||||
|
|
||||||
// Have a starting '%' - look for matching '%'
|
// Have a starting '%' - look for matching '%'
|
||||||
int envlen = 0;
|
int envlen = 0;
|
||||||
const unsigned short *pTmp = pIn + 1;
|
const WCHAR *pTmp = pIn + 1;
|
||||||
while ( *pTmp != L'%' && *pTmp != L' ' ) {
|
while ( *pTmp != L'%' && *pTmp != L' ' ) {
|
||||||
envlen++, pTmp++;
|
envlen++, pTmp++;
|
||||||
if ( origLen < index + envlen ) { // Ran past end of original
|
if ( origLen < index + envlen ) { // Ran past end of original
|
||||||
|
@ -274,7 +274,7 @@ unsigned int ExpandEnvironmentStringsW(const unsigned short* lpSrc,
|
||||||
return size;
|
return size;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned short *
|
WCHAR *
|
||||||
mozce_GetEnvironmentCL()
|
mozce_GetEnvironmentCL()
|
||||||
{
|
{
|
||||||
env_entry *entry = env_head;
|
env_entry *entry = env_head;
|
||||||
|
|
|
@ -47,14 +47,14 @@ extern "C" {
|
||||||
/* Environment stuff */
|
/* Environment stuff */
|
||||||
char* getenv(const char* inName);
|
char* getenv(const char* inName);
|
||||||
int putenv(const char *a);
|
int putenv(const char *a);
|
||||||
char SetEnvironmentVariableW(const unsigned short * name, const unsigned short * value );
|
char SetEnvironmentVariableW(const wchar_t * name, const wchar_t * value );
|
||||||
char GetEnvironmentVariableW(const unsigned short * lpName, unsigned short* lpBuffer, unsigned long nSize);
|
char GetEnvironmentVariableW(const wchar_t * lpName, wchar_t* lpBuffer, unsigned long nSize);
|
||||||
|
|
||||||
unsigned int ExpandEnvironmentStringsW(const unsigned short* lpSrc,
|
unsigned int ExpandEnvironmentStringsW(const wchar_t* lpSrc,
|
||||||
unsigned short* lpDst,
|
wchar_t* lpDst,
|
||||||
unsigned int nSize);
|
unsigned int nSize);
|
||||||
|
|
||||||
unsigned short* mozce_GetEnvironmentCL();
|
wchar_t* mozce_GetEnvironmentCL();
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
};
|
};
|
||||||
|
|
|
@ -38,8 +38,6 @@
|
||||||
#ifndef MOZCE_SHUNT_H
|
#ifndef MOZCE_SHUNT_H
|
||||||
#define MOZCE_SHUNT_H
|
#define MOZCE_SHUNT_H
|
||||||
|
|
||||||
#include "environment.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
@ -53,6 +51,8 @@ typedef unsigned short wchar_t;
|
||||||
} //extern "C"
|
} //extern "C"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "environment.h"
|
||||||
|
|
||||||
#ifdef MOZ_MEMORY
|
#ifdef MOZ_MEMORY
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
@ -182,18 +182,18 @@ void abort(void);
|
||||||
/* Environment stuff */
|
/* Environment stuff */
|
||||||
char* getenv(const char* inName);
|
char* getenv(const char* inName);
|
||||||
int putenv(const char *a);
|
int putenv(const char *a);
|
||||||
char SetEnvironmentVariableW(const unsigned short * name, const unsigned short * value );
|
char SetEnvironmentVariableW(const wchar_t * name, const wchar_t * value );
|
||||||
char GetEnvironmentVariableW(const unsigned short * lpName, unsigned short* lpBuffer, unsigned long nSize);
|
char GetEnvironmentVariableW(const wchar_t * lpName, wchar_t* lpBuffer, unsigned long nSize);
|
||||||
|
|
||||||
unsigned int ExpandEnvironmentStringsW(const unsigned short* lpSrc,
|
unsigned int ExpandEnvironmentStringsW(const wchar_t* lpSrc,
|
||||||
unsigned short* lpDst,
|
wchar_t* lpDst,
|
||||||
unsigned int nSize);
|
unsigned int nSize);
|
||||||
|
|
||||||
/* File system stuff */
|
/* File system stuff */
|
||||||
unsigned short * _wgetcwd(unsigned short* dir, unsigned long size);
|
wchar_t * _wgetcwd(wchar_t* dir, unsigned long size);
|
||||||
unsigned short *_wfullpath( unsigned short *absPath, const unsigned short *relPath, unsigned long maxLength );
|
wchar_t *_wfullpath(wchar_t *absPath, const wchar_t *relPath, unsigned long maxLength );
|
||||||
int _unlink(const char *filename );
|
int _unlink(const char *filename );
|
||||||
int _wchdir(const unsigned short* path);
|
int _wchdir(const wchar_t* path);
|
||||||
|
|
||||||
/* The time stuff should be defined here, but it can't be because it
|
/* The time stuff should be defined here, but it can't be because it
|
||||||
is already defined in time.h.
|
is already defined in time.h.
|
||||||
|
@ -228,7 +228,7 @@ struct tm* localtime_r(const time_t* inTimeT, struct tm* outRetval);
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
unsigned short* mozce_GetEnvironmentCL();
|
wchar_t* mozce_GetEnvironmentCL();
|
||||||
|
|
||||||
/* square root of 1/2, missing from math.h */
|
/* square root of 1/2, missing from math.h */
|
||||||
#define M_SQRT1_2 0.707106781186547524401
|
#define M_SQRT1_2 0.707106781186547524401
|
||||||
|
|
|
@ -113,15 +113,15 @@ int errno = 0;
|
||||||
// File System Stuff
|
// File System Stuff
|
||||||
////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////
|
||||||
|
|
||||||
unsigned short * _wgetcwd(unsigned short * dir, unsigned long size)
|
wchar_t * _wgetcwd(wchar_t * dir, unsigned long size)
|
||||||
{
|
{
|
||||||
unsigned short tmp[MAX_PATH] = {0};
|
wchar_t tmp[MAX_PATH] = {0};
|
||||||
GetEnvironmentVariableW(L"CWD", tmp, size);
|
GetEnvironmentVariableW(L"CWD", tmp, size);
|
||||||
if (tmp && tmp[0]) {
|
if (tmp && tmp[0]) {
|
||||||
if (wcslen(tmp) > size)
|
if (wcslen(tmp) > size)
|
||||||
return 0;
|
return 0;
|
||||||
if (!dir) {
|
if (!dir) {
|
||||||
dir = (unsigned short*)malloc(sizeof(unsigned short) * (wcslen(tmp) + 2));
|
dir = (wchar_t*)malloc(sizeof(wchar_t) * (wcslen(tmp) + 2));
|
||||||
if (!dir)
|
if (!dir)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -129,7 +129,7 @@ unsigned short * _wgetcwd(unsigned short * dir, unsigned long size)
|
||||||
} else {
|
} else {
|
||||||
unsigned long i;
|
unsigned long i;
|
||||||
if (!dir) {
|
if (!dir) {
|
||||||
dir = (unsigned short*)malloc(sizeof(unsigned short) * (MAX_PATH + 1));
|
dir = (wchar_t*)malloc(sizeof(wchar_t) * (MAX_PATH + 1));
|
||||||
if (!dir)
|
if (!dir)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -147,12 +147,12 @@ unsigned short * _wgetcwd(unsigned short * dir, unsigned long size)
|
||||||
return dir;
|
return dir;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned short *_wfullpath( unsigned short *absPath, const unsigned short *relPath, unsigned long maxLength )
|
wchar_t *_wfullpath( wchar_t *absPath, const wchar_t *relPath, unsigned long maxLength )
|
||||||
{
|
{
|
||||||
if(absPath == NULL){
|
if(absPath == NULL){
|
||||||
absPath = (unsigned short *)malloc(maxLength*sizeof(unsigned short));
|
absPath = (wchar_t *)malloc(maxLength*sizeof(wchar_t));
|
||||||
}
|
}
|
||||||
unsigned short cwd[MAX_PATH];
|
wchar_t cwd[MAX_PATH];
|
||||||
if (NULL == _wgetcwd( cwd, MAX_PATH))
|
if (NULL == _wgetcwd( cwd, MAX_PATH))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
@ -181,7 +181,7 @@ int _wchdir(const WCHAR* path) {
|
||||||
|
|
||||||
int _unlink(const char *filename)
|
int _unlink(const char *filename)
|
||||||
{
|
{
|
||||||
unsigned short wname[MAX_PATH];
|
wchar_t wname[MAX_PATH];
|
||||||
|
|
||||||
MultiByteToWideChar(CP_ACP,
|
MultiByteToWideChar(CP_ACP,
|
||||||
0,
|
0,
|
||||||
|
|
|
@ -197,8 +197,8 @@ GRE_GetGREPathWithProperties(const GREVersionRange *versions,
|
||||||
#elif WINCE
|
#elif WINCE
|
||||||
if (p[0] != '\\')
|
if (p[0] != '\\')
|
||||||
{
|
{
|
||||||
unsigned short dir[MAX_PATH];
|
WCHAR dir[MAX_PATH];
|
||||||
unsigned short path[MAX_PATH];
|
WCHAR path[MAX_PATH];
|
||||||
MultiByteToWideChar(CP_ACP, 0, p, -1, path, MAX_PATH);
|
MultiByteToWideChar(CP_ACP, 0, p, -1, path, MAX_PATH);
|
||||||
_wfullpath(dir,path,MAX_PATH);
|
_wfullpath(dir,path,MAX_PATH);
|
||||||
WideCharToMultiByte(CP_ACP, 0, dir, -1, aBuffer, MAX_PATH, NULL, NULL);
|
WideCharToMultiByte(CP_ACP, 0, dir, -1, aBuffer, MAX_PATH, NULL, NULL);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче