diff --git a/caps/src/nsZip.c b/caps/src/nsZip.c index 0377de5f09a..3a3ecac29dd 100644 --- a/caps/src/nsZip.c +++ b/caps/src/nsZip.c @@ -23,6 +23,9 @@ #include #include #include +#ifdef XP_MAC +#include "macstdlibextras.h" /* for strncasecmp */ +#endif #include #if !(XP_MAC) #include diff --git a/cmd/macfe/Composer/CSpellChecker.cp b/cmd/macfe/Composer/CSpellChecker.cp index 1a7eb005ae6..cbae888dad4 100644 --- a/cmd/macfe/Composer/CSpellChecker.cp +++ b/cmd/macfe/Composer/CSpellChecker.cp @@ -43,6 +43,8 @@ #include "prlink.h" +#define MAX_MAC_FILENAME 31 + /* The difference between calling the spell checker lib from a DLL or from a static linked lib depends on whether we're generating CFM code (and on whether the static lib was included in the application project) */ diff --git a/cmd/macfe/central/earlmgr.cp b/cmd/macfe/central/earlmgr.cp index 477534de16d..f1c4b35d190 100644 --- a/cmd/macfe/central/earlmgr.cp +++ b/cmd/macfe/central/earlmgr.cp @@ -45,6 +45,7 @@ extern "C" { #include "resgui.h" #ifdef NSPR20 +#include "prthread.h" PR_BEGIN_EXTERN_C PR_EXTERN(PRThread*) PR_GetPrimaryThread(void); PR_END_EXTERN_C diff --git a/cmd/macfe/utility/xp_file_mac.cp b/cmd/macfe/utility/xp_file_mac.cp index f99ea6aacdc..4556694c926 100644 --- a/cmd/macfe/utility/xp_file_mac.cp +++ b/cmd/macfe/utility/xp_file_mac.cp @@ -1329,9 +1329,8 @@ int XP_FileDuplicateResourceFork( const char* oldFilePath, XP_FileType oldType, // I put these stubs here. They can go away when we move to MSL. //====================================== -PR_EXTERN(char*) PR_GetEnv(const char *var); +#include "prenv.h" /* For PR_GetEnv */ extern "C" { - char* PR_GetEnv(const char *var); char* getenv(const char *var); } diff --git a/cmd/winfe/stdafx.h b/cmd/winfe/stdafx.h index 35c4633335f..e69de29bb2d 100644 --- a/cmd/winfe/stdafx.h +++ b/cmd/winfe/stdafx.h @@ -1,123 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public License - * Version 1.0 (the "NPL"); you may not use this file except in - * compliance with the NPL. You may obtain a copy of the NPL at - * http://www.mozilla.org/NPL/ - * - * Software distributed under the NPL is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL - * for the specific language governing rights and limitations under the - * NPL. - * - * The Initial Developer of this code under the NPL is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All Rights - * Reserved. - */ - -#ifndef STDAFX_PCH -#define STDAFX_PCH - -#define OEMRESOURCE - -#if defined(DEBUG_blythe) -// Set up a flag specific to WFE developers in the client -#define DEBUG_WFE -#endif - -/* Very windows specific includes. - */ -/* MFC, KFC, RUN DMC, whatever */ -#include -#include -#include -#include -#include -#include -#ifdef _WIN32 -#include -#endif - -/* More XP than anything */ -#include "xp.h" -#include "fe_proto.h" -#include "fe_rgn.h" -#include "libi18n.h" -#include "xlate.h" -#include "ntypes.h" -#ifdef EDITOR -#include "edttypes.h" -#endif -#include "xpassert.h" -#include "lo_ele.h" -#include "layers.h" - -/* Standard C includes */ -#ifndef _WIN32 -#include -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#ifdef DEBUG -#include -#endif - - - - -/* Very windows specific includes. - */ -/* WFE needs a layout file */ -extern "C" { -#include "layout.h" -} - -/* Some common defines. */ -#ifndef _AFXDLL -#define new DEBUG_NEW -#endif - -/* All front end forward declarations needed to compile. */ -#include "forward.h" - -/* Front end Casting macros. */ -#include "cast.h" - -/* General purpose utilities. */ -#include "feutil.h" - -/* afxData/sysInfo */ -#include "sysinfo.h" - -/* Some defines we like everywhere. */ -#include "resource.h" -#include "defaults.h" - -/* The application include and - * Commonly used, rarely changed headers */ -#include "ncapiurl.h" -#include "genedit.h" -#include "genframe.h" -#include "genview.h" -#include "gendoc.h" -#include "intlwin.h" -#include "mozilla.h" -#include "cxwin.h" -#include "winproto.h" - -#ifdef DEBUG - #ifdef assert - #undef assert - #endif - #define assert(x) ASSERT(x) -#endif - -#endif /* STDAFX_PCH */ diff --git a/cmd/winfe/xpstrdll/src/makefile.win b/cmd/winfe/xpstrdll/src/makefile.win index 6078499ab7e..cb29e59b7e1 100644 --- a/cmd/winfe/xpstrdll/src/makefile.win +++ b/cmd/winfe/xpstrdll/src/makefile.win @@ -28,6 +28,7 @@ DEPTH=..\..\..\.. OBJS = $(OBJS) .\$(OBJDIR)\xpstrdll.obj RCFLAGS=\ /I$(DEPTH)\include \ + /I$(DIST)\include \ /I$(DEPTH)\dist\public\security \ !if "$(MOZ_BITS)" == "32" /DWIN32 \ diff --git a/cmd/xfe/icons.c b/cmd/xfe/icons.c index 8bb23b1af1b..a0dd3109e7e 100644 --- a/cmd/xfe/icons.c +++ b/cmd/xfe/icons.c @@ -76,11 +76,7 @@ #include "icondata.h" #include "icons.h" -#ifndef NSPR20 -#include "prosdep.h" /* for IS_LITTLE_ENDIAN / IS_BIG_ENDIAN */ -#else -#include "prtypes.h" -#endif +#include "prtypes.h" /* for IS_LITTLE_ENDIAN / IS_BIG_ENDIAN */ #include /* for XP_GetString() */ diff --git a/cmd/xfe/icons/mkicons.cpp b/cmd/xfe/icons/mkicons.cpp index e36e657b90b..985b89659c7 100644 --- a/cmd/xfe/icons/mkicons.cpp +++ b/cmd/xfe/icons/mkicons.cpp @@ -25,11 +25,7 @@ #define JMC_INIT_IMGCB_ID #define JMC_INIT_IMGCBIF_ID -#ifndef NSPR20 -#include "prosdep.h" -#else #include "prtypes.h" -#endif static char* header_comment = "/*\n" diff --git a/include/MANIFEST b/include/MANIFEST index 641b61fbc0d..941303ed965 100644 --- a/include/MANIFEST +++ b/include/MANIFEST @@ -92,6 +92,7 @@ xp_md5.h xp_mem.h xp_mesg.h xp_ncent.h +xp_path.h xp_qsort.h xp_rgb.h xp_str.h diff --git a/include/net.h b/include/net.h index b576fbe72bb..1d6f5cba7ea 100644 --- a/include/net.h +++ b/include/net.h @@ -31,6 +31,7 @@ #define _NET_PROTO_H_ #include "xp_core.h" +#include "prio.h" #include "ntypes.h" #include "shistele.h" #include "xp_list.h" diff --git a/include/xp_core.h b/include/xp_core.h index b738130a49d..00e69522fa2 100644 --- a/include/xp_core.h +++ b/include/xp_core.h @@ -36,15 +36,8 @@ And TRUE, FALSE, ON, OFF, YES, NO -----------------------------------------------------------------------------*/ -#ifdef NSPR20 #include "prtypes.h" /* for intn, etc. */ -#ifdef XP_MAC -#include "prosdep.h" -#else -#include "md/prosdep.h" -#endif #include "prlog.h" -#endif /* NSPR20 */ #ifndef _XP_Core_ #define _XP_Core_ @@ -155,14 +148,6 @@ /* simple common types */ -#if defined(XP_WIN) || defined(XP_OS2) -#ifndef RESOURCE_STR -#include "prtypes.h" -#endif /* RESOURCE_STR */ -#else /* XP_WIN */ -#include "prtypes.h" -#endif /* XP_WIN */ - #ifdef XP_MAC #include @@ -180,7 +165,6 @@ typedef int Bool; typedef int XP_Bool; #elif defined(XP_OS2) && !defined(RC_INVOKED) -#include "prosdep.h" typedef unsigned long Bool; typedef unsigned long XP_Bool; #else @@ -194,6 +178,10 @@ typedef char XP_Bool; #endif +#if !defined(XP_WIN) +typedef int (*FARPROC)(); +#endif + #if defined(XP_WIN) #ifndef BOOL #define BOOL Bool @@ -215,15 +203,7 @@ #define FALSE 0 #endif -/* disable the TRUE redefinition warning - * TRUE is defined by windows.h in the MSVC - * development environment, and creates a - * nasty warning for every file. The only - * way to turn it off is to disable all - * macro redefinition warnings or to not - * define TRUE here - */ -#if !defined(TRUE) && !defined(XP_WIN) +#ifndef TRUE #define TRUE !FALSE #endif diff --git a/include/xp_file.h b/include/xp_file.h index 82a6cf5cb56..27487df8a2d 100644 --- a/include/xp_file.h +++ b/include/xp_file.h @@ -20,6 +20,8 @@ #ifndef _XP_File_ #define _XP_File_ +#include "xp_path.h" + #define XP_FILE_NATIVE_PATH char * #define XP_FILE_URL_PATH char* /*----------------------------------------------------------------------------- diff --git a/include/xp_path.h b/include/xp_path.h new file mode 100644 index 00000000000..f307617db0a --- /dev/null +++ b/include/xp_path.h @@ -0,0 +1,51 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * + * The contents of this file are subject to the Netscape Public License + * Version 1.0 (the "NPL"); you may not use this file except in + * compliance with the NPL. You may obtain a copy of the NPL at + * http://www.mozilla.org/NPL/ + * + * Software distributed under the NPL is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL + * for the specific language governing rights and limitations under the + * NPL. + * + * The Initial Developer of this code under the NPL is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All Rights + * Reserved. + */ + +/* + * The contents of this file used to be part of prosdep.h, + * a private NSPR header file of the NSPR module. The macros + * defined in this file are the only things the Mozilla + * client needs from prosdep.h, so I extracted them and put + * them in this new file. + * -- Wan-Teh Chang , 18 September 1998 + */ + +#ifndef _XP_PATH_H +#define _XP_PATH_H + +#if defined(XP_UNIX) || defined(XP_MAC) +#define PR_DIRECTORY_SEPARATOR '/' +#define PR_DIRECTORY_SEPARATOR_STR "/" +#define PR_PATH_SEPARATOR ':' +#define PR_PATH_SEPARATOR_STR ":" +#elif defined(XP_PC) /* Win32, Win16, and OS/2 */ +#define PR_DIRECTORY_SEPARATOR '\\' +#define PR_DIRECTORY_SEPARATOR_STR "\\" +#define PR_PATH_SEPARATOR ';' +#define PR_PATH_SEPARATOR_STR ";" +#else +#error "Unknown platform" +#endif + +#ifdef XP_MAC +#define PATH_SEPARATOR_STR ":" +#define DIRECTORY_SEPARATOR_STR "/" +#define MAXPATHLEN 512 +#endif + +#endif /* _XP_PATH_H */ diff --git a/js/src/liveconnect/jsj_private.h b/js/src/liveconnect/jsj_private.h index 85e1c040f94..d2064e4fb86 100644 --- a/js/src/liveconnect/jsj_private.h +++ b/js/src/liveconnect/jsj_private.h @@ -44,7 +44,7 @@ #endif #ifdef XP_MAC -# include "prosdep.h" +#include "macstdlibextras.h" /* for strdup() */ #endif #include "jsj_hash.h" /* Hash tables */ diff --git a/js/src/prmjtime.c b/js/src/prmjtime.c index dbb1654a467..158ae0a1aeb 100644 --- a/js/src/prmjtime.c +++ b/js/src/prmjtime.c @@ -25,20 +25,6 @@ #include #include #include "prtypes.h" - -/* - * Not sure if prosdep is required on any platform but, for now, - * we're including it on non-Unix platforms. - */ -#ifndef NSPR20 -#include "prosdep.h" -#else -#ifdef XP_MAC -#include "prosdep.h" -#elif defined(XP_WIN) -#include "md/prosdep.h" -#endif -#endif #include "prprf.h" #include "prmjtime.h" diff --git a/lib/layout/edtcmd.cpp b/lib/layout/edtcmd.cpp index 37b9909e6ef..58b225a5dca 100644 --- a/lib/layout/edtcmd.cpp +++ b/lib/layout/edtcmd.cpp @@ -26,6 +26,10 @@ #ifdef EDITOR #include "editor.h" +#ifdef XP_UNIX +#include /* for getpid() */ +#endif + #ifdef DEBUG const char* kCommandNames[kCommandIDMax+1] = { diff --git a/lib/liblayer/src/cl_layer.c b/lib/liblayer/src/cl_layer.c index 8f271b99954..cb1987d3fed 100644 --- a/lib/liblayer/src/cl_layer.c +++ b/lib/liblayer/src/cl_layer.c @@ -26,6 +26,9 @@ #include "xp_list.h" #include "layers.h" #include "cl_priv.h" +#ifdef XP_MAC +#include "macstdlibextras.h" /* for strdup */ +#endif static void cl_hidden_changed(CL_Layer *layer); diff --git a/lib/mac/UserInterface/CApplicationEventAttachment.cp b/lib/mac/UserInterface/CApplicationEventAttachment.cp index 46a3bb3d833..68b024577ef 100644 --- a/lib/mac/UserInterface/CApplicationEventAttachment.cp +++ b/lib/mac/UserInterface/CApplicationEventAttachment.cp @@ -30,6 +30,10 @@ #include "nspr.h" #include "CMochaHacks.h" +enum { + kPrivateNSPREventType = 13 +}; + // --------------------------------------------------------------------------------- // ¥ [Static data members] // --------------------------------------------------------------------------------- @@ -156,4 +160,4 @@ void CApplicationEventAttachment::ProcessNextEvent() { GetApplication().ProcessNextEvent(); -} \ No newline at end of file +} diff --git a/modules/libimg/src/if.h b/modules/libimg/src/if.h index d217dcaceee..4955be93540 100644 --- a/modules/libimg/src/if.h +++ b/modules/libimg/src/if.h @@ -18,7 +18,7 @@ /* if.h --- Top-level image library internal routines * - * $Id: if.h,v 3.2 1998-07-27 16:09:30 hardts%netscape.com Exp $ + * $Id: if.h,v 3.3 1998-09-22 16:59:42 wtc%netscape.com Exp $ */ #ifndef _if_h @@ -103,11 +103,7 @@ extern PRLogModuleInfo *il_log_module; #define FREE_IF_NOT_NULL(x) do {if (x) {PR_FREEIF(x); (x) = NULL;}} while (0) -#ifndef NSPR20 -#include "prosdep.h" /* for IS_LITTLE_ENDIAN / IS_BIG_ENDIAN */ -#else #include "prtypes.h" /* for IS_LITTLE_ENDIAN / IS_BIG_ENDIAN */ -#endif /* The imagelib labels bits in a 32-bit word from 31 on the left to 0 on the right. This macro performs the necessary conversion to make that definition work on diff --git a/modules/libreg/src/VerReg.c b/modules/libreg/src/VerReg.c index fd2fd8126b2..b063965bf42 100644 --- a/modules/libreg/src/VerReg.c +++ b/modules/libreg/src/VerReg.c @@ -31,7 +31,6 @@ * -------------------------------------------------------------------- */ #include -#include #if defined(XP_WIN) #include @@ -39,7 +38,6 @@ #include #include -#include #include #include "reg.h" @@ -354,7 +352,9 @@ static REGERR vr_GetCheck(char *path, int32 *check) return REGERR_NOFILE; case EACCES: /* file in use */ +#ifdef EMFILE /* Mac doesn't have EMFILE. */ case EMFILE: /* too many files open */ +#endif default: return REGERR_FAIL; } diff --git a/modules/libreg/src/reg.c b/modules/libreg/src/reg.c index e7d246653ab..fa1662bc409 100644 --- a/modules/libreg/src/reg.c +++ b/modules/libreg/src/reg.c @@ -41,9 +41,7 @@ #include #include -#include #include -#include #ifdef SUNOS4 #include /* for SEEK_SET */ @@ -56,6 +54,10 @@ #ifndef MAX_PATH #define MAX_PATH 1024 #endif +#elif defined(WIN32) +#include /* for MAX_PATH */ +#elif defined(XP_MAC) +#define MAX_PATH 512 #endif @@ -206,7 +208,9 @@ static REGERR nr_OpenFile(char *path, FILEHANDLE *fh) else return REGERR_FAIL; +#ifdef EMFILE /* Mac doesn't have EMFILE. */ case EMFILE: /* too many files open */ +#endif default: return REGERR_FAIL; } diff --git a/modules/libreg/src/vr_stubs.c b/modules/libreg/src/vr_stubs.c index a65d0ea526f..b17b3a1c400 100644 --- a/modules/libreg/src/vr_stubs.c +++ b/modules/libreg/src/vr_stubs.c @@ -21,7 +21,6 @@ */ #include -#include #ifndef STANDALONE_REGISTRY #include "prtypes.h" diff --git a/modules/libreg/src/vr_stubs.h b/modules/libreg/src/vr_stubs.h index 3de53db25f8..a79d3127ebf 100644 --- a/modules/libreg/src/vr_stubs.h +++ b/modules/libreg/src/vr_stubs.h @@ -25,6 +25,10 @@ #define _VR_STUBS_H_ #include +#include +#ifdef XP_MAC +#include "macstdlibextras.h" /* For strcasecmp and strncasecmp */ +#endif #ifdef XP_MAC #include diff --git a/modules/rdf/src/hist2rdf.h b/modules/rdf/src/hist2rdf.h index 389fd93eb46..15ef5f68ac4 100644 --- a/modules/rdf/src/hist2rdf.h +++ b/modules/rdf/src/hist2rdf.h @@ -31,11 +31,7 @@ #include -#ifndef NSPR20 -#include "prosdep.h" /* for IS_LITTLE_ENDIAN / IS_BIG_ENDIAN */ -#else -#include "prtypes.h" -#endif +#include "prtypes.h" /* for IS_LITTLE_ENDIAN / IS_BIG_ENDIAN */ diff --git a/modules/softupdt/src/nsFolderSpec.cpp b/modules/softupdt/src/nsFolderSpec.cpp index a1317c7763a..aa7044b1167 100644 --- a/modules/softupdt/src/nsFolderSpec.cpp +++ b/modules/softupdt/src/nsFolderSpec.cpp @@ -37,11 +37,6 @@ #define MAX_PATH _MAX_PATH #endif #ifdef XP_UNIX -#ifdef NSPR20 -#include "md/prosdep.h" -#else -#include "prosdep.h" -#endif #if defined(HPUX) || defined(SCO) /* ** HPUX: PATH_MAX is defined in to be 1023, but they diff --git a/modules/softupdt/src/su_folderspec.c b/modules/softupdt/src/su_folderspec.c index e94702aa210..c9d9017d004 100644 --- a/modules/softupdt/src/su_folderspec.c +++ b/modules/softupdt/src/su_folderspec.c @@ -35,11 +35,6 @@ #define MAX_PATH _MAX_PATH #endif #ifdef XP_UNIX -#ifdef NSPR20 -#include "md/prosdep.h" -#else -#include "prosdep.h" -#endif #if defined(HPUX) || defined(SCO) /* ** HPUX: PATH_MAX is defined in to be 1023, but they diff --git a/network/cache/extcache.h b/network/cache/extcache.h index ac4d3da9fd6..35f1f8c1313 100644 --- a/network/cache/extcache.h +++ b/network/cache/extcache.h @@ -50,11 +50,7 @@ #ifndef EXT_DB_ROUTINES -#ifndef NSPR20 -#include "prosdep.h" /* for IS_LITTLE_ENDIAN / IS_BIG_ENDIAN */ -#else -#include "prtypes.h" -#endif +#include "prtypes.h" /* for IS_LITTLE_ENDIAN / IS_BIG_ENDIAN */ #endif /* EXT_DB_ROUTINES */ diff --git a/network/cnvts/cvextcon.c b/network/cnvts/cvextcon.c index 17088f1181a..771dcf2a1b2 100644 --- a/network/cnvts/cvextcon.c +++ b/network/cnvts/cvextcon.c @@ -19,6 +19,7 @@ */ #include "xp.h" +#include "prmem.h" #include "plstr.h" #include "netutils.h" #include "mkselect.h" diff --git a/network/cnvts/cvview.c b/network/cnvts/cvview.c index 3a89204a95b..b2c260b404f 100644 --- a/network/cnvts/cvview.c +++ b/network/cnvts/cvview.c @@ -18,6 +18,7 @@ /* Please leave outside of ifdef for windows precompiled headers */ #include "xp.h" +#include "prmem.h" #include "plstr.h" #include "netutils.h" #include "mkselect.h" @@ -34,6 +35,19 @@ #include "libmime.h" +/* for select(), fd_set, struct timeval */ +#if defined(XP_UNIX) +#include +#include +#include +#if defined(AIX) +#include +#endif +#elif defined(XP_WIN) +#include +#elif defined(XP_MAC) +#include "macsocket.h" +#endif /* for XP_GetString() */ #include diff --git a/network/main/MacBinSupport.c b/network/main/MacBinSupport.c index 25ace5e78f1..3ffdbc11c09 100644 --- a/network/main/MacBinSupport.c +++ b/network/main/MacBinSupport.c @@ -87,6 +87,8 @@ MacBinary header creation and CRC calculation based on Erny Tontlinger's free 'T #include "MoreFilesExtras.h" +#include + enum { kMB_SendingHeader, /* Data from read is MB header */ diff --git a/network/protocol/file/mkfile.c b/network/protocol/file/mkfile.c index d606efa4843..46193ec334d 100644 --- a/network/protocol/file/mkfile.c +++ b/network/protocol/file/mkfile.c @@ -494,7 +494,7 @@ net_open_file (ActiveEntry * cur_entry) /* if errno is equal to "Too many open files" * return a special error */ -#ifndef XP_MAC +#ifdef EMFILE /* Mac doesn't have EMFILE. */ if(errno == EMFILE) return(MK_TOO_MANY_OPEN_FILES); else diff --git a/nsprpub/pr/include/md/_macos.h b/nsprpub/pr/include/md/_macos.h index 919bca415a1..f1e2d5c6651 100644 --- a/nsprpub/pr/include/md/_macos.h +++ b/nsprpub/pr/include/md/_macos.h @@ -462,13 +462,11 @@ typedef short PROSFD; // Errors not found in the Mac StdCLib #define EACCES 13 // Permission denied #define ENOENT -43 // No such file or directory -#define EMFILE 24 // Too many open files #define _OS_INVALID_FD_VALUE -1 #define STDERR_FILENO 2 #if !defined(MAC_NSPR_STANDALONE) -#define MAC_PATH_SEPARATOR ':' #define PATH_SEPARATOR ':' #define PATH_SEPARATOR_STR ":" #define DIRECTORY_SEPARATOR '/' @@ -478,10 +476,6 @@ typedef short PROSFD; #define UNIX_THIS_DIRECTORY_STR "./" #define UNIX_PARENT_DIRECTORY_STR "../" -#define MAX_PATH 512 -#define MAX_MAC_FILENAME 31 -#define MAXPATHLEN MAX_PATH - // Alias a few names #define getenv PR_GetEnv @@ -533,10 +527,6 @@ extern void dprintf(const char *format, ...); extern PRUint8 CallCacheFlushers(size_t blockSize); #endif -enum { - kPrivateNSPREventType = 13 -}; - #if defined(MAC_NSPR_STANDALONE) extern void* reallocSmaller(void* block, size_t newSize); #endif