From 342c277ab9192bb2a0a51a8b569458b931fe6b7e Mon Sep 17 00:00:00 2001 From: Miro Jurisic Date: Tue, 8 Sep 1998 19:56:55 +0000 Subject: [PATCH] Added check for CFM git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@10913 dc483132-0cff-0310-8789-dd5450dbe970 --- src/mac/CFMglue.c | 17 +++++++++++++++++ src/mac/ChangeLog | 3 +++ 2 files changed, 20 insertions(+) diff --git a/src/mac/CFMglue.c b/src/mac/CFMglue.c index b2270885d..4daf5d866 100644 --- a/src/mac/CFMglue.c +++ b/src/mac/CFMglue.c @@ -1,4 +1,6 @@ #include +#include +#include // Private function prototypes @@ -7,6 +9,8 @@ static OSErr Find_Symbol( Str255 pSymName, ProcInfoType pProcInfo); +static pascal Boolean HaveCFM(void); + static pascal OSErr GetSystemArchitecture(OSType *archType); /* This code is directly from Technote 1077 */ @@ -40,6 +44,13 @@ static pascal OSErr GetSystemArchitecture(OSType *archType) return tOSErr; } +static pascal Boolean HaveCFM(void) +{ + long response; + return ( (Gestalt (gestaltCFMAttr, &response) == noErr) && + (((response >> gestaltCFMPresent) & 1) != 0)); +} + static OSErr Find_Symbol( Ptr* pSymAddr, Str255 pSymName, @@ -61,6 +72,12 @@ static OSErr Find_Symbol( if (sOSErr != noErr) return sOSErr; // OOPS! } + + if (!HaveCFM()) { + // If we don't have CFM68K, return a reasonable-looking error. + sOSErr = cfragLibConnErr; + return sOSErr; + } if (sArchType == kMotorola68KCFragArch) // ...for CFM68K tISAType = kM68kISA | kCFM68kRTA; diff --git a/src/mac/ChangeLog b/src/mac/ChangeLog index 0337462c7..55a5781db 100644 --- a/src/mac/ChangeLog +++ b/src/mac/ChangeLog @@ -1,3 +1,6 @@ +Fri Sep 8 15:50:00 1998 Miro Jurisic + * CFMGlue.c: Added check for Code Fragment Manager + Fri Aug 28 16:30:00 1998 Miro Jurisic * Makefile.tmpl, ReadMe, Makefile.initial, RunAppleScript.pl: Added stuff to -- 2.26.2