MinGW fix for bug 250392 p=brofield@jellycan.com r=me sr=dmose

git-svn-id: svn://10.0.0.236/trunk@166889 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
neil%parkwaycc.co.uk
2004-12-20 16:27:12 +00:00
parent 7900d886eb
commit a5ca8a395d
2 changed files with 43 additions and 3 deletions

View File

@@ -528,9 +528,9 @@ MangleTextToValidFilename(nsString & aText)
aText.StripChars(FILE_PATH_SEPARATOR FILE_ILLEGAL_CHARACTERS);
aText.CompressWhitespace(PR_TRUE, PR_TRUE);
int nameLen;
for (int n = 0; n < NS_ARRAY_LENGTH(forbiddenNames); ++n) {
nameLen = strlen(forbiddenNames[n]);
PRUint32 nameLen;
for (size_t n = 0; n < NS_ARRAY_LENGTH(forbiddenNames); ++n) {
nameLen = (PRUint32) strlen(forbiddenNames[n]);
if (aText.EqualsIgnoreCase(forbiddenNames[n], nameLen)) {
// invalid name is either the entire string, or a prefix with a period
if (aText.Length() == nameLen || aText.CharAt(nameLen) == PRUnichar('.')) {

View File

@@ -63,6 +63,46 @@
#define CFSTR_INETURLW "UniformResourceLocatorW"
#endif
// For support of MinGW w32api v2.4.
// When the next version of w32api is released with shlobj.h rev 1.35
// http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/winsup/w32api/include/shlobj.h?cvsroot=src
// then that can be made the base required version and this code should be removed.
#ifndef CFSTR_FILEDESCRIPTORA
# define CFSTR_FILEDESCRIPTORA "FileGroupDescriptor"
#endif
#ifndef CFSTR_FILEDESCRIPTORW
# define CFSTR_FILEDESCRIPTORW "FileGroupDescriptorW"
#endif
#ifdef __MINGW32__
# include <w32api.h>
# if __W32API_MAJOR_VERSION < 3 || (__W32API_MAJOR_VERSION == 3 && __W32API_MINOR_VERSION == 0)
# ifndef FILEGROUPDESCRIPTORA
# define FILEGROUPDESCRIPTORA FILEGROUPDESCRIPTOR
# endif
# ifndef LPFILEGROUPDESCRIPTORA
# define LPFILEGROUPDESCRIPTORA LPFILEGROUPDESCRIPTOR
# endif
typedef struct _FILEDESCRIPTORW {
DWORD dwFlags;
CLSID clsid;
SIZEL sizel;
POINTL pointl;
DWORD dwFileAttributes;
FILETIME ftCreationTime;
FILETIME ftLastAccessTime;
FILETIME ftLastWriteTime;
DWORD nFileSizeHigh;
DWORD nFileSizeLow;
WCHAR cFileName[MAX_PATH];
} FILEDESCRIPTORW,*LPFILEDESCRIPTORW;
typedef struct _FILEGROUPDESCRIPTORW {
UINT cItems;
FILEDESCRIPTORW fgd[1];
} FILEGROUPDESCRIPTORW,*LPFILEGROUPDESCRIPTORW;
# endif /*__W32API_MAJOR_VERSION*/
#endif /*__MINGW32__*/
class nsVoidArray;
class CEnumFormatEtc;
class nsITransferable;