From 60da5dabedb95afc789f7c060108662f5bddfc8e Mon Sep 17 00:00:00 2001 From: "sfraser%netscape.com" Date: Wed, 27 Mar 2002 04:17:20 +0000 Subject: [PATCH] Changes required to build and debug with CodeWarrior Pro 7.2 and Universal Headers 3.4.1. r=wtc --- nsprpub/pr/src/md/mac/macdll.c | 20 +++++++++++++++++--- nsprpub/pr/src/md/mac/macsocket.h | 1 + nsprpub/pr/src/md/mac/macsockotpt.c | 1 + 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/nsprpub/pr/src/md/mac/macdll.c b/nsprpub/pr/src/md/mac/macdll.c index 017f120089d6..0750cd12b7ad 100644 --- a/nsprpub/pr/src/md/mac/macdll.c +++ b/nsprpub/pr/src/md/mac/macdll.c @@ -504,15 +504,26 @@ done: OSErr NSLoadNamedFragment(const FSSpec *fileSpec, const char* fragmentName, CFragConnectionID *outConnectionID) { UInt32 fragOffset, fragLength; + short fragNameLength; Ptr main; - Str255 fragName = "\p"; + Str255 fragName; Str255 errName; OSErr err; err = GetNamedFragmentOffsets(fileSpec, fragmentName, &fragOffset, &fragLength); if (err != noErr) return err; - err = GetDiskFragment(fileSpec, fragOffset, fragLength, fileSpec->name, + // convert fragment name to pascal string + fragNameLength = strlen(fragmentName); + if (fragNameLength > 255) + fragNameLength = 255; + BlockMoveData(fragmentName, &fragName[1], fragNameLength); + fragName[0] = fragNameLength; + + // Note that we pass the fragment name as the 4th param to GetDiskFragment. + // This value affects the ability of debuggers, and the Talkback system, + // to match code fragments with symbol files + err = GetDiskFragment(fileSpec, fragOffset, fragLength, fragName, kLoadCFrag, outConnectionID, &main, errName); return err; @@ -555,7 +566,10 @@ OSErr NSLoadIndexedFragment(const FSSpec *fileSpec, PRUint32 fragmentIndex, fragName[0] = nameLen; } - err = GetDiskFragment(fileSpec, fragOffset, fragLength, fileSpec->name, + // Note that we pass the fragment name as the 4th param to GetDiskFragment. + // This value affects the ability of debuggers, and the Talkback system, + // to match code fragments with symbol files + err = GetDiskFragment(fileSpec, fragOffset, fragLength, fragName, kLoadCFrag, outConnectionID, &main, errName); if (err != noErr) { diff --git a/nsprpub/pr/src/md/mac/macsocket.h b/nsprpub/pr/src/md/mac/macsocket.h index b1045e366f5d..b9194c521d4d 100644 --- a/nsprpub/pr/src/md/mac/macsocket.h +++ b/nsprpub/pr/src/md/mac/macsocket.h @@ -39,6 +39,7 @@ // Interface visible to xp code // C socket type definitions and routines // from sys/socket.h +#include #include // All the internet typedefs #include // For timeval /* diff --git a/nsprpub/pr/src/md/mac/macsockotpt.c b/nsprpub/pr/src/md/mac/macsockotpt.c index 7bbee0395259..424627403fa2 100644 --- a/nsprpub/pr/src/md/mac/macsockotpt.c +++ b/nsprpub/pr/src/md/mac/macsockotpt.c @@ -38,6 +38,7 @@ #include #include +#include #include #include