Stop using FlatCarbon headers on Mac OS X. b=482277 r=bsmedberg
authorJosh Aas <joshmoz@gmail.com>
Thu, 19 Mar 2009 10:41:13 -0700
changeset 26366 b8dde9bd27382ea4c41c52bb303ba96eab1591be
parent 26365 d641ee2bf81246fdab92fcee4662a1cdd5d16325
child 26367 9f4b54ad549d5aae2067bd156097dbb3cc8d5615
push idunknown
push userunknown
push dateunknown
reviewersbsmedberg
bugs482277
milestone1.9.2a1pre
Stop using FlatCarbon headers on Mac OS X. b=482277 r=bsmedberg
browser/components/migration/src/nsMacIEProfileMigrator.cpp
configure.in
content/events/src/nsEventStateManager.cpp
embedding/components/find/src/nsWebBrowserFind.cpp
gfx/thebes/src/gfxQuartzFontCache.mm
intl/locale/public/nsIMacLocale.h
intl/locale/src/mac/nsCollationMac.cpp
intl/locale/src/mac/nsMacLocale.cpp
intl/locale/src/nsLocaleService.cpp
intl/uconv/src/nsMacCharset.cpp
media/liboggplay/src/liboggplay/Makefile.in
modules/libreg/src/VerReg.c
modules/libreg/src/nr_bufio.c
modules/libreg/src/vr_stubs.c
netwerk/base/src/nsURLHelperOSX.cpp
profile/dirserviceprovider/src/nsProfileLock.cpp
toolkit/components/commandlines/src/nsCommandLine.cpp
toolkit/profile/src/nsToolkitProfileService.cpp
toolkit/xre/nsAppRunner.cpp
uriloader/exthandler/mac/nsInternetConfig.h
uriloader/exthandler/mac/nsInternetConfig.mm
uriloader/exthandler/nsIInternetConfigService.idl
widget/public/nsIPrintSessionX.idl
widget/public/nsIPrintSettingsX.idl
widget/src/cocoa/nsDeviceContextSpecX.h
xpcom/glue/nsGREGlue.cpp
xpcom/io/SpecialSystemDirectory.h
xpcom/io/nsAppFileLocationProvider.cpp
xpcom/io/nsDirectoryService.cpp
xpcom/io/nsILocalFileMac.idl
--- a/browser/components/migration/src/nsMacIEProfileMigrator.cpp
+++ b/browser/components/migration/src/nsMacIEProfileMigrator.cpp
@@ -43,17 +43,17 @@
 #include "nsIObserverService.h"
 #include "nsIProfileMigrator.h"
 #include "nsIServiceManager.h"
 #include "nsIStringBundle.h"
 #include "nsISupportsArray.h"
 #include "nsISupportsPrimitives.h"
 #include "nsServiceManagerUtils.h"
 #include "nsIProperties.h"
-#include <InternetConfig.h>
+#include <Carbon/Carbon.h>
 
 #define MACIE_BOOKMARKS_FILE_NAME NS_LITERAL_STRING("Favorites.html")
 #define MACIE_PREFERENCES_FOLDER_NAME NS_LITERAL_STRING("Explorer")
 #define MACIE_DEFAULT_HOMEPAGE_PREF  "\p4D534945„WWWHomePage"
 #define TEMP_BOOKMARKS_FILE_NAME NS_LITERAL_STRING("bookmarks_tmp.html")
 
 #define MIGRATION_BUNDLE "chrome://browser/locale/migration/migration.properties"
 
--- a/configure.in
+++ b/configure.in
@@ -4846,17 +4846,16 @@ cairo-cocoa)
     AC_DEFINE(MOZ_WIDGET_COCOA)
     MOZ_ENABLE_COCOA=1
     MOZ_GFX_TOOLKIT=cairo
     MOZ_USER_DIR="Mozilla"
     AC_DEFINE(XP_MACOSX)
     AC_DEFINE(TARGET_CARBON)
     AC_DEFINE(TARGET_API_MAC_CARBON)
     TK_LIBS='-framework Carbon -framework CoreAudio -framework AudioToolbox -framework AudioUnit -framework AddressBook'
-    TK_CFLAGS="-I${MACOS_SDK_DIR}/Developer/Headers/FlatCarbon"
     CFLAGS="$CFLAGS $TK_CFLAGS"
     CXXFLAGS="$CXXFLAGS $TK_CFLAGS"
     ;;
 esac
 
 if test "$MOZ_ENABLE_XREMOTE"; then
     AC_DEFINE(MOZ_ENABLE_XREMOTE)
 fi
--- a/content/events/src/nsEventStateManager.cpp
+++ b/content/events/src/nsEventStateManager.cpp
@@ -149,17 +149,17 @@
 #include "nsIDragSession.h"
 #include "nsDOMDataTransfer.h"
 #include "nsContentAreaDragDrop.h"
 #ifdef MOZ_XUL
 #include "nsTreeBodyFrame.h"
 #endif
 
 #ifdef XP_MACOSX
-#include <Events.h>
+#include <Carbon/Carbon.h>
 #endif
 
 //#define DEBUG_DOCSHELL_FOCUS
 
 #define NS_USER_INTERACTION_INTERVAL 5000 // ms
 
 static NS_DEFINE_CID(kFrameTraversalCID, NS_FRAMETRAVERSAL_CID);
 
--- a/embedding/components/find/src/nsWebBrowserFind.cpp
+++ b/embedding/components/find/src/nsWebBrowserFind.cpp
@@ -78,17 +78,17 @@
 
 #if DEBUG
 #include "nsIWebNavigation.h"
 #include "nsXPIDLString.h"
 #endif
 
 #ifdef XP_MACOSX
 #include "nsAutoPtr.h"
-#include <Scrap.h>
+#include <Carbon/Carbon.h>
 #endif
 
 
 //*****************************************************************************
 // nsWebBrowserFind
 //*****************************************************************************
 
 nsWebBrowserFind::nsWebBrowserFind() :
--- a/gfx/thebes/src/gfxQuartzFontCache.mm
+++ b/gfx/thebes/src/gfxQuartzFontCache.mm
@@ -33,17 +33,17 @@
  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *
  * ***** END LICENSE BLOCK ***** */
 
-#include <Carbon.h>
+#include <Carbon/Carbon.h>
 
 #import <AppKit/AppKit.h>
 
 #include "gfxPlatformMac.h"
 #include "gfxQuartzFontCache.h"
 #include "gfxAtsuiFonts.h"
 #include "gfxUserFontSet.h"
 
--- a/intl/locale/public/nsIMacLocale.h
+++ b/intl/locale/public/nsIMacLocale.h
@@ -36,17 +36,17 @@
  * ***** END LICENSE BLOCK ***** */
 #ifndef nsIMacLocale_h__
 #define nsIMacLocale_h__
 
 
 #include "nsISupports.h"
 #include "nscore.h"
 #include "nsString.h"
-#include <Script.h>
+#include <Carbon/Carbon.h>
 
 // {E58B24B2-FD1A-11d2-9E8E-0060089FE59B}
 #define NS_IMACLOCALE_IID                \
 {  0xe58b24b2, 0xfd1a, 0x11d2,           \
 {  0x9e, 0x8e, 0x0, 0x60, 0x8, 0x9f, 0xe5, 0x9b }}  
 
 
 class nsIMacLocale : public nsISupports {
--- a/intl/locale/src/mac/nsCollationMac.cpp
+++ b/intl/locale/src/mac/nsCollationMac.cpp
@@ -30,20 +30,20 @@
  * under the terms of either the GPL or the LGPL, and not to allow others to
  * use your version of this file under the terms of the MPL, indicate your
  * decision by deleting the provisions above and replace them with the notice
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
+
+#include <Carbon/Carbon.h>
+
 #include "nsCollationMac.h"
-#include <Resources.h>
-#include <TextUtils.h>
-#include <Script.h>
 #include "prmem.h"
 #include "prmon.h"
 #include "nsIServiceManager.h"
 #include "nsIComponentManager.h"
 #include "nsILocaleService.h"
 #include "nsLocaleCID.h"
 #include "nsIPlatformCharset.h"
 #include "nsIMacLocale.h"
--- a/intl/locale/src/mac/nsMacLocale.cpp
+++ b/intl/locale/src/mac/nsMacLocale.cpp
@@ -30,25 +30,26 @@
  * use your version of this file under the terms of the MPL, indicate your
  * decision by deleting the provisions above and replace them with the notice
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
+#include <Carbon/Carbon.h>
+
 #include "nsISupports.h"
 #include "nscore.h"
 #include "nsString.h"
 #include "nsReadableUtils.h"
 #include "nsILocale.h"
 #include "nsMacLocale.h"
 #include "nsLocaleCID.h"
 #include "prprf.h"
-#include <Script.h>
 #include "nsReadableUtils.h"
 #include "nsXPCOMStrings.h"
 
 struct iso_lang_map
 {
   char*  iso_code;
   short  mac_lang_code;
   short  mac_script_code;
--- a/intl/locale/src/nsLocaleService.cpp
+++ b/intl/locale/src/nsLocaleService.cpp
@@ -49,17 +49,16 @@
 #include <ctype.h>
 
 #if defined(XP_WIN)
 #  include "nsIWin32Locale.h"
 #elif defined(XP_OS2)
 #  include "unidef.h"
 #  include "nsIOS2Locale.h"
 #elif defined(XP_MACOSX)
-#  include <Script.h>
 #  include <Carbon/Carbon.h>
 #  include "nsIMacLocale.h"
 #elif defined(XP_UNIX) || defined(XP_BEOS)
 #  include <locale.h>
 #  include <stdlib.h>
 #  include "nsIPosixLocale.h"
 #endif
 
--- a/intl/uconv/src/nsMacCharset.cpp
+++ b/intl/uconv/src/nsMacCharset.cpp
@@ -30,18 +30,17 @@
  * use your version of this file under the terms of the MPL, indicate your
  * decision by deleting the provisions above and replace them with the notice
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
-#include <Script.h>
-#include <TextCommon.h>
+#include <Carbon/Carbon.h>
 #include "nsIPlatformCharset.h"
 #include "pratom.h"
 #include "nsGREResProperties.h"
 #include "nsUConvDll.h"
 #include "nsCOMPtr.h"
 #include "nsIComponentManager.h"
 #include "nsIMacLocale.h"
 #include "nsLocaleCID.h"
--- a/media/liboggplay/src/liboggplay/Makefile.in
+++ b/media/liboggplay/src/liboggplay/Makefile.in
@@ -64,8 +64,12 @@ CSRCS		= \
 		oggplay_callback_info.c \
 		oggplay_buffer.c \
 		oggplay_seek.c \
 		oggplay_yuv2rgb.c \
 		oggplay_tools.c \
 		$(NULL)
 
 include $(topsrcdir)/config/rules.mk
+
+ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
+LOCAL_INCLUDES += -I$(MACOS_SDK_DIR)/Developer/Headers/FlatCarbon
+endif
--- a/modules/libreg/src/VerReg.c
+++ b/modules/libreg/src/VerReg.c
@@ -72,17 +72,17 @@
 #include <assert.h>
 #endif /*STANDALONE_REGISTRY*/
 
 #include "reg.h"
 #include "NSReg.h"
 #include "VerReg.h"
 
 #if defined(XP_MACOSX)
-#include <Folders.h>
+#include <Carbon/Carbon.h>
 #endif
 
 /* -------- local defines --------------- 
 */
 #define MAXREGVERLEN 32     /* Version=12345.12345.12345.12345 */
 
 #define VERSTR          "Version"
 #define CHKSTR          "Check"
--- a/modules/libreg/src/nr_bufio.c
+++ b/modules/libreg/src/nr_bufio.c
@@ -47,18 +47,19 @@
  * Inspired by the performance gains James L. Nance <jim_nance@yahoo.com>
  * got using NSPR memory-mapped I/O for the registry. Unfortunately NSPR 
  * doesn't support mmapio on the Mac.
  *-----------------------------------------------------------------------*/
 
 #include <stdio.h>
 #include <string.h>
 #include <errno.h>
-#if defined(XP_MAC) || defined(XP_MACOSX)
-  #include <Errors.h>
+
+#if defined(XP_MACOSX)
+#include <Carbon/Carbon.h>
 #endif
 
 #if defined(SUNOS4)
 #include <unistd.h>  /* for SEEK_SET */
 #endif /* SUNOS4 */
 
 #include "prerror.h"
 #include "prlog.h"
--- a/modules/libreg/src/vr_stubs.c
+++ b/modules/libreg/src/vr_stubs.c
@@ -217,18 +217,17 @@ int FAR PASCAL _export WEP(int nParam)
 #endif /* XP_WIN */
 
 
 /* ------------------------------------------------------------------
  *  MACINTOSH STUBS
  * ------------------------------------------------------------------
  */
 
-#if defined(XP_MAC) || defined(XP_MACOSX)
-#include <Files.h>
+#if defined(XP_MACOSX)
 
 #ifdef STANDALONE_REGISTRY
 extern XP_File vr_fileOpen(const char *name, const char * mode)
 {
     XP_File fh = NULL;
     struct stat st;
     
 #ifdef STANDALONE_REGISTRY
--- a/netwerk/base/src/nsURLHelperOSX.cpp
+++ b/netwerk/base/src/nsURLHelperOSX.cpp
@@ -40,17 +40,17 @@
  * ***** END LICENSE BLOCK ***** */
 
 /* Mac OS X-specific local file uri parsing */
 #include "nsURLHelper.h"
 #include "nsEscape.h"
 #include "nsILocalFile.h"
 #include "nsTArray.h"
 #include "nsReadableUtils.h"
-#include <Files.h>
+#include <Carbon/Carbon.h>
 
 static nsTArray<nsCString> *gVolumeList = nsnull;
 
 static PRBool pathBeginsWithVolName(const nsACString& path, nsACString& firstPathComponent)
 {
   // Return whether the 1st path component in path (escaped) is equal to the name
   // of a mounted volume. Return the 1st path component (unescaped) in any case.
   // This needs to be done as quickly as possible, so we cache a list of volume names.
--- a/profile/dirserviceprovider/src/nsProfileLock.cpp
+++ b/profile/dirserviceprovider/src/nsProfileLock.cpp
@@ -40,18 +40,18 @@
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsProfileStringTypes.h"
 #include "nsProfileLock.h"
 #include "nsCOMPtr.h"
 
 #if defined(XP_MACOSX)
-#include <Processes.h>
-#include <CFBundle.h>
+#include <Carbon/Carbon.h>
+#include <CoreFoundation/CoreFoundation.h>
 #endif
 
 #ifdef XP_UNIX
 #include <unistd.h>
 #include <fcntl.h>
 #include <errno.h>
 #include <signal.h>
 #include <stdlib.h>
--- a/toolkit/components/commandlines/src/nsCommandLine.cpp
+++ b/toolkit/components/commandlines/src/nsCommandLine.cpp
@@ -52,17 +52,17 @@
 #include "nsNativeCharsetUtils.h"
 #include "nsNetUtil.h"
 #include "nsUnicharUtils.h"
 #include "nsTArray.h"
 #include "nsXPCOMCID.h"
 #include "plstr.h"
 
 #ifdef XP_MACOSX
-#include <CFURL.h>
+#include <CoreFoundation/CoreFoundation.h>
 #include "nsILocalFileMac.h"
 #elif defined(XP_WIN)
 #include <windows.h>
 #include <shlobj.h>
 #elif defined(XP_BEOS)
 #include <Path.h>
 #include <Directory.h>
 #elif defined(XP_UNIX)
--- a/toolkit/profile/src/nsToolkitProfileService.cpp
+++ b/toolkit/profile/src/nsToolkitProfileService.cpp
@@ -52,17 +52,17 @@
 
 #include "nsIToolkitProfileService.h"
 #include "nsIToolkitProfile.h"
 #include "nsIFactory.h"
 #include "nsILocalFile.h"
 #include "nsISimpleEnumerator.h"
 
 #ifdef XP_MACOSX
-#include <CFURL.h>
+#include <CoreFoundation/CoreFoundation.h>
 #include "nsILocalFileMac.h"
 #endif
 
 #include "nsAppDirectoryServiceDefs.h"
 #include "nsXULAppAPI.h"
 
 #include "nsINIParser.h"
 #include "nsXREDirProvider.h"
--- a/toolkit/xre/nsAppRunner.cpp
+++ b/toolkit/xre/nsAppRunner.cpp
@@ -176,18 +176,17 @@
 #include "nsTraceMalloc.h"
 #endif
 
 #if defined(DEBUG) && defined(XP_WIN32)
 #include <malloc.h>
 #endif
 
 #if defined (XP_MACOSX)
-#include <Processes.h>
-#include <Events.h>
+#include <Carbon/Carbon.h>
 #endif
 
 #ifdef DEBUG
 #include "prlog.h"
 #endif
 
 #ifdef MOZ_JPROF
 #include "jprof.h"
--- a/uriloader/exthandler/mac/nsInternetConfig.h
+++ b/uriloader/exthandler/mac/nsInternetConfig.h
@@ -33,17 +33,17 @@
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
  
 #ifndef __NS_INTERNETCONFIG_H__
 #define __NS_INTERNETCONFIG_H__
 
-#include <InternetConfig.h>
+#include <Carbon/Carbon.h>
 #include "prtypes.h"
 #include "nsError.h"
 
 class nsInternetConfig
 {
 public:
 	nsInternetConfig();
 	~nsInternetConfig();
--- a/uriloader/exthandler/mac/nsInternetConfig.mm
+++ b/uriloader/exthandler/mac/nsInternetConfig.mm
@@ -36,17 +36,18 @@
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsInternetConfig.h"
 #include "nsObjCExceptions.h"
 #include "nsString.h"
 #include "nsReadableUtils.h"
 #include "nsDebug.h"
 
-#include <Processes.h>
+#include <Carbon/Carbon.h>
+
 ICInstance nsInternetConfig::sInstance = NULL;
 long nsInternetConfig::sSeed = 0;
 PRInt32  nsInternetConfig::sRefCount = 0;
 
 
 
 static OSType GetAppCreatorCode()
 {
--- a/uriloader/exthandler/nsIInternetConfigService.idl
+++ b/uriloader/exthandler/nsIInternetConfigService.idl
@@ -37,17 +37,17 @@
 
 #include "nsISupports.idl"
 
 interface nsIMIMEInfo;
 interface nsIURL;
 
 %{C++
 
-#include <Files.h>
+#include <Carbon/Carbon.h>
 
 #define NS_INTERNETCONFIGSERVICE_CONTRACTID \
 "@mozilla.org/mac/internet-config-service;1"
 
 %}
 
 native FSSpec(FSSpec);
 [ptr] native FSSpecPtr(FSSpec);
--- a/widget/public/nsIPrintSessionX.idl
+++ b/widget/public/nsIPrintSessionX.idl
@@ -34,17 +34,17 @@
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsIPrintSession.idl"
 
 %{ C++
-#include <PMApplication.h>
+#include <Carbon/Carbon.h>
 %}
 
 /**
  * Native types
  */
 native nsPMPrintSession(PMPrintSession);
 
 /**
--- a/widget/public/nsIPrintSettingsX.idl
+++ b/widget/public/nsIPrintSettingsX.idl
@@ -35,17 +35,17 @@
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsISupports.idl"
 
 %{ C++
-#include <PMApplication.h>
+#include <Carbon/Carbon.h>
 %}
 
 /**
  * Native types
  */
 native nsPMPageFormat(PMPageFormat);
 native nsPMPrintSettings(PMPrintSettings);
 native nsPMPrintSession(PMPrintSession);
--- a/widget/src/cocoa/nsDeviceContextSpecX.h
+++ b/widget/src/cocoa/nsDeviceContextSpecX.h
@@ -36,17 +36,17 @@
  *
  * ***** END LICENSE BLOCK ***** */
 
 #ifndef nsDeviceContextSpecX_h_
 #define nsDeviceContextSpecX_h_
 
 #include "nsIDeviceContextSpec.h"
 
-#include <PMApplication.h>
+#include <Carbon/Carbon.h>
 
 class nsDeviceContextSpecX : public nsIDeviceContextSpec
 {
 public:
     /**
      * Construct a nsDeviceContextSpecX, which is an object which contains and manages a mac printrecord
      * @update  dc 12/02/98
      */
--- a/xpcom/glue/nsGREGlue.cpp
+++ b/xpcom/glue/nsGREGlue.cpp
@@ -53,17 +53,17 @@
 # include <mbstring.h>
 # include <io.h>
 # define snprintf _snprintf
 # define R_OK 04
 #elif defined(XP_OS2)
 # define INCL_DOS
 # include <os2.h>
 #elif defined(XP_MACOSX)
-# include <CFBundle.h>
+# include <CoreFoundation/CoreFoundation.h>
 # include <unistd.h>
 # include <dirent.h>
 #elif defined(XP_UNIX)
 # include <unistd.h>
 # include <sys/param.h>
 # include <dirent.h>
 #elif defined(XP_BEOS)
 # include <FindDirectory.h>
--- a/xpcom/io/SpecialSystemDirectory.h
+++ b/xpcom/io/SpecialSystemDirectory.h
@@ -40,17 +40,17 @@
 
 #ifndef _SPECIALSYSTEMDIRECTORY_H_
 #define _SPECIALSYSTEMDIRECTORY_H_
 
 #include "nscore.h"
 #include "nsILocalFile.h"
 
 #ifdef XP_MACOSX
-#include <Types.h>
+#include <Carbon/Carbon.h>
 #include "nsILocalFileMac.h"
 #include "prenv.h"
 #endif
 
 
 extern NS_COM void StartupSpecialSystemDirectory();
 extern NS_COM void ShutdownSpecialSystemDirectory();
 
--- a/xpcom/io/nsAppFileLocationProvider.cpp
+++ b/xpcom/io/nsAppFileLocationProvider.cpp
@@ -44,20 +44,17 @@
 #include "nsILocalFile.h"
 #include "nsString.h"
 #include "nsXPIDLString.h"
 #include "nsISimpleEnumerator.h"
 #include "prenv.h"
 #include "nsCRT.h"
 
 #if defined(XP_MACOSX)
-#include <Folders.h>
-#include <Script.h>
-#include <Processes.h>
-#include <Gestalt.h>
+#include <Carbon/Carbon.h>
 #include "nsILocalFileMac.h"
 #elif defined(XP_OS2)
 #define INCL_DOSPROCESS
 #define INCL_DOSMODULEMGR
 #include <os2.h>
 #elif defined(XP_WIN)
 #include <windows.h>
 #include <shlobj.h>
--- a/xpcom/io/nsDirectoryService.cpp
+++ b/xpcom/io/nsDirectoryService.cpp
@@ -58,23 +58,17 @@
 #include <stdio.h>
 #elif defined(XP_UNIX)
 #include <unistd.h>
 #include <stdlib.h>
 #include <sys/param.h>
 #include "prenv.h"
 #ifdef XP_MACOSX
 #include <CoreServices/CoreServices.h>
-#include <Folders.h>
-#include <Files.h>
-#include <Memory.h>
-#include <Processes.h>
-#include <Gestalt.h>
-#include <CFURL.h>
-#include <InternetConfig.h>
+#include <Carbon/Carbon.h>
 #endif
 #elif defined(XP_OS2)
 #define MAX_PATH _MAX_PATH
 #elif defined(XP_BEOS)
 #include <FindDirectory.h>
 #include <Path.h>
 #include <unistd.h>
 #include <stdlib.h>
--- a/xpcom/io/nsILocalFileMac.idl
+++ b/xpcom/io/nsILocalFileMac.idl
@@ -35,18 +35,18 @@
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsILocalFile.idl"
 
 %{C++
-#include <Files.h>
-#include <CFURL.h>
+#include <Carbon/Carbon.h>
+#include <CoreFoundation/CoreFoundation.h>
 %}
 
       native OSType(OSType);
       native FSSpec(FSSpec);
 [ptr] native FSSpecPtr(FSSpec);
       native FSRef(FSRef);
 [ptr] native FSRefPtr(FSRef);
       native CFURLRef(CFURLRef);