Remove libreg dependency on morefilesx. b=464362 r=smichaud sr=bsmedberg
authorJosh Aas <joshmoz@gmail.com>
Thu, 29 Jan 2009 23:49:27 -0500
changeset 24430 5f976f704de5da46d31ad4c858edb9c86c44bcf4
parent 24429 3b2f69cc7004f97c026ddf096968ef561884fbea
child 24431 e339871a30ce5503368599b7a752fa66e4cf3f8a
push id5044
push userjosh@mozilla.com
push dateFri, 30 Jan 2009 04:47:51 +0000
treeherdermozilla-central@5f976f704de5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmichaud, bsmedberg
bugs464362
milestone1.9.2a1pre
Remove libreg dependency on morefilesx. b=464362 r=smichaud sr=bsmedberg
modules/libreg/src/Makefile.in
modules/libreg/src/reg.c
modules/libreg/standalone/Makefile.in
xpcom/build/Makefile.in
--- a/modules/libreg/src/Makefile.in
+++ b/modules/libreg/src/Makefile.in
@@ -42,21 +42,16 @@ VPATH		= @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 include $(srcdir)/objs.mk
 
 MODULE		= libreg
 LIBRARY_NAME	= mozreg_s
 DIST_INSTALL = 1
 
-# MacOSX requires the MoreFiles module
-ifeq ($(OS_ARCH),Darwin)
-REQUIRES = macmorefiles
-endif
-
 CSRCS		= $(MODULES_LIBREG_SRC_LCSRCS) nr_bufio.c
 
 BIN_SRCS	= VerReg.c reg.c vr_stubs.c
 PROGOBJS        = $(addprefix R_,$(BIN_SRCS:.c=.o))
 
 # We don't want a shared lib.  Static lib only.
 FORCE_STATIC_LIB = 1
 
@@ -65,20 +60,16 @@ FORCE_USE_PIC	= 1
 
 # We do want this in the static libraries list
 EXPORT_LIBRARY = 1
 
 USE_STATIC_LIBS = 1
 
 SDK_LIBRARY = $(LIBRARY)
 
-ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
-SHARED_LIBRARY_LIBS += $(DEPTH)/xpcom/MoreFiles/libmacmorefiles_s.a
-endif
-
 include $(topsrcdir)/config/config.mk
 
 DEFINES         += -DUSE_BUFFERED_REGISTRY_IO	
 # Memory mapped files are not supported under QNX, Neutrino, HP-UX and BeOS
 #ifeq (,$(filter BeOS HP-UX QNX,$(OS_ARCH)))
 #CSRCS		+= mmapio.c
 #DEFINES		+= -DUSE_MMAP_REGISTRY_IO
 #endif
--- a/modules/libreg/src/reg.c
+++ b/modules/libreg/src/reg.c
@@ -146,26 +146,21 @@
 static PRLock   *reglist_lock = NULL;
 #endif
 
 static REGFILE  *RegList = NULL;
 static int32    regStartCount = 0;
 char            *globalRegName = NULL;
 static char     *user_name = NULL;
 
-
-
-
 #ifdef XP_MACOSX
 
 void nr_MacAliasFromPath(const char * fileName, void ** alias, int32 * length);
 char * nr_PathFromMacAlias(const void * alias, uint32 aliasLength);
 
-#include "MoreFilesX.h"
-
 static void copyCStringToPascal(Str255 dest, const char *src)
 {
     size_t copyLen = strlen(src);
     if (copyLen > 255)
         copyLen = 255;
     BlockMoveData(src, &dest[1], copyLen);
     dest[0] = copyLen;
 }
@@ -181,19 +176,19 @@ static OSErr isFileInTrash(FSRef *fsRef,
 
     err = FSGetCatalogInfo(fsRef, kFSCatInfoVolume, &catalogInfo, NULL, NULL, NULL);
     if (err == noErr)
     {
         FSRef trashFSRef, currFSRef, parentFSRef;
         err = FSFindFolder(catalogInfo.volume, kTrashFolderType, false, &trashFSRef);
         if (err == noErr)
         {
-            /* FSRefGetParentRef returns noErr and a zeroed FSRef when it reaches the top */
             for (currFSRef = *fsRef;
-                 (FSGetParentRef(&currFSRef, &parentFSRef) == noErr && FSRefValid(&parentFSRef));
+                 (FSGetCatalogInfo(&currFSRef, kFSCatInfoNodeID, NULL, NULL, NULL, &parentFSRef) == noErr &&
+                  FSGetCatalogInfo(&parentFSRef, kFSCatInfoNone, NULL, NULL, NULL, NULL) == noErr);
                  currFSRef = parentFSRef)
             {
                 if (FSCompareFSRefs(&parentFSRef, &trashFSRef) == noErr)
                 {
                     *inTrash = PR_TRUE;
                     break;
                 }
             }
--- a/modules/libreg/standalone/Makefile.in
+++ b/modules/libreg/standalone/Makefile.in
@@ -42,21 +42,16 @@ srcdir		= @srcdir@
 VPATH		= @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 include $(srcdir)/../src/objs.mk
 
 MODULE		= libreg
 LIBRARY_NAME	= mozregsa_s
 
-# MacOSX requires the MoreFiles module
-ifeq ($(OS_ARCH),Darwin)
-REQUIRES = macmorefiles
-endif
-
 ifeq ($(OS_ARCH),WINNT)
 USE_STATIC_LIBS = 1
 endif
 
 CSRCS		= $(MODULES_LIBREG_SRC_LCSRCS)
 
 FORCE_STATIC_LIB = 1
 
--- a/xpcom/build/Makefile.in
+++ b/xpcom/build/Makefile.in
@@ -62,17 +62,17 @@ endif
 
 GRE_MODULE	= 1
 MOZILLA_INTERNAL_API = 1
 
 REQUIRES	= string \
 		  $(NULL)
 
 # pull in MoreFiles for MacOSX
-ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
+ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
 REQUIRES += macmorefiles
 endif
 
 ifdef NS_TRACE_MALLOC
 REQUIRES += tracemalloc
 endif
 
 CSRCS		= \
@@ -170,22 +170,22 @@ EXTRA_DSO_LDOPTS += $(NSPR_LIBS)
 ifdef GC_LEAK_DETECTOR
 DEFINES += -DGC_LEAK_DETECTOR
 endif
 
 ifdef TARGET_XPCOM_ABI
 DEFINES += -DTARGET_XPCOM_ABI=\"$(TARGET_XPCOM_ABI)\"
 endif
 
-ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
+ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
 CXXFLAGS	+= $(TK_CFLAGS)
 EXTRA_DSO_LDOPTS += \
-  ../MoreFiles/$(LIB_PREFIX)macmorefiles_s.$(LIB_SUFFIX) \
   $(TK_LIBS) \
   $(NULL)
+SHARED_LIBRARY_LIBS += $(DEPTH)/xpcom/MoreFiles/libmacmorefiles_s.a
 endif
 
 ifeq ($(OS_ARCH),BeOS)
 EXTRA_DSO_LDOPTS += -lbe
 endif
 
 ifneq (,$(filter gtk2,$(MOZ_WIDGET_TOOLKIT)))
 EXTRA_DSO_LDOPTS += $(MOZ_GTK2_LIBS)