#if defined(_WIN32)
#include <io.h>
#endif
-#ifdef macintosh
-#include "icons.h"
-static void MacMessageBox(char *errbuf);
-#endif
static /*@null@*/ et_old_error_hook_func com_err_hook = 0;
static void default_com_err_proc (const char *whoami, errcode_t code,
const char *fmt, va_list ap)
{
-#if defined(_WIN32) || defined(macintosh)
+#if defined(_WIN32)
char errbuf[1024] = "";
vsprintf (errbuf + strlen (errbuf), fmt, ap);
errbuf[sizeof(errbuf) - 1] = '\0';
-#ifdef macintosh
- MacMessageBox(errbuf);
-#else
#ifdef _WIN32
if (_isatty(_fileno(stderr))) {
fputs(errbuf, stderr);
} else
#endif /* _WIN32 */
MessageBox ((HWND)NULL, errbuf, "Kerberos", MB_ICONEXCLAMATION);
-#endif /* macintosh */
-#else /* !_WIN32 && !macintosh */
+#else /* !_WIN32 */
if (whoami) {
fputs(whoami, stderr);
return x;
}
#endif
-
-#ifdef macintosh
-static void MacMessageBox(errbuf)
- char *errbuf;
-{
- WindowPtr errWindow;
- ControlHandle errOkButton;
- Rect errOkButtonRect = { 120, 220, 140, 280 };
- Rect errRect = { 0, 0, 150, 300 };
- GDHandle mainDevice = GetMainDevice();
- Rect mainRect = (**mainDevice).gdRect;
- Rect tmpRect;
- Rect errTextRect = { 10, 70, 110, 290 };
- Rect errIconRect = { 10, 10, 10 + 32, 10 + 32 };
- EventRecord theEvent;
- Point localPt;
- Boolean done;
- long gestaltResult;
- OSErr theError;
-
- /* Find Centered rect for window */
- tmpRect.top = ((mainRect.bottom + mainRect.top)/2 -
- (errRect.bottom + errRect.top)/2);
- tmpRect.bottom = tmpRect.top + (errRect.bottom - errRect.top);
- tmpRect.left = ((mainRect.right + mainRect.left)/2 -
- (errRect.right + errRect.left)/2);
- tmpRect.right = tmpRect.left + (errRect.right - errRect.left);
-
- /* Create the error window - as a dialog window */
- /* First check if we have color QuickDraw */
- /* (we can assume we have Gestalt because we are on system 7) */
- theError = Gestalt (gestaltQuickdrawFeatures, &gestaltResult);
- if ((theError == noErr) && (gestaltResult & (1 << gestaltHasColor) != 0))
- errWindow = NewCWindow(NULL, &tmpRect, "\p", TRUE, dBoxProc, (WindowPtr) -1, FALSE, 0L);
- else
- errWindow = NewWindow(NULL, &tmpRect, "\p", TRUE, dBoxProc, (WindowPtr) -1, FALSE, 0L);
-
- SetPort(errWindow);
- TextFont(systemFont);
- TextSize(12);
-
- errOkButton = NewControl(errWindow, &errOkButtonRect,
- "\pOk", TRUE, 0, 0, 1, pushButProc, 0L);
- DrawControls(errWindow);
- InsetRect(&errOkButtonRect, -4, -4);
- PenSize(3,3);
- FrameRoundRect(&errOkButtonRect, 15,15);
- PenSize(1,1);
- InsetRect(&errOkButtonRect, 4, 4);
-
- /* Draw the error text */
- TETextBox(errbuf, strlen(errbuf), &errTextRect, teForceLeft);
-
- /* Draw the Stop icon */
- PlotIcon(&errIconRect, GetResource('ICON', 0));
-
- /* mini event loop here */
- done = FALSE;
- while(!done) {
- WaitNextEvent(mDownMask | mUpMask | keyDownMask, &theEvent, 15, nil);
- if (theEvent.what == mouseDown) {
- localPt = theEvent.where;
- GlobalToLocal(&localPt);
- if (TestControl(errOkButton, localPt) &&
- TrackControl(errOkButton, localPt, NULL)) {
- done = TRUE;
- }
- } else if (theEvent.what == keyDown &&
- (theEvent.message & 0xff) == 0x0d || /* CR */
- (theEvent.message & 0xff) == 0x03 || /* Enter */
- (theEvent.message & 0xff) == 0x1b) { /* Escape */
- long t;
- /* Hilite the button for a bit */
- HiliteControl(errOkButton, 1);
- Delay(5, &t);
- /* Dehilite the button */
- HiliteControl(errOkButton, 0);
- done = TRUE;
- }
- }
-
- /* Dispose of the Window, disposes of controls */
- DisposeWindow(errWindow);
-}
-#endif
#include "com_err.h"
#include "error_table.h"
-#if defined(macintosh) || (defined(__MACH__) && defined(__APPLE__))
-# include <KerberosSupport/KerberosSupport.h>
-# include <KerberosSupport/ErrorLib.h>
-#endif
-
#if defined(_WIN32)
#define HAVE_STRERROR
#endif
-#ifdef macintosh
-#define sys_nerr 100 /* XXX - What is this? */
-#endif
-
#if !defined(HAVE_STRERROR) && !defined(SYS_ERRLIST_DECLARED)
extern char const * const sys_errlist[];
-#ifndef macintosh
extern const int sys_nerr;
#endif
-#endif
static char buffer[ET_EBUFSIZ];
-#if (defined(_WIN32) || defined(macintosh) || (defined(__MACH__) && defined(__APPLE__)))
+#if (defined(_WIN32) || TARGET_OS_MAC
/*@null@*/ static struct et_list * _et_list = (struct et_list *) NULL;
#else
/* Old interface compatibility */
#if TARGET_OS_MAC
{
- /* This may be a Mac OS Toolbox error or an MIT Support Library Error. Ask ErrorLib */
- if (GetErrorLongString(code, buffer, ET_EBUFSIZ - 1) == noErr) {
- return buffer;
- }
-
-#if TARGET_API_MAC_OSX
- /* ComErr and ErrorLib don't know about this error, ask the system */
+ /* ComErr doesn't know about this error, ask the system */
/* Of course there's no way to tell if it knew what error it got */
return (strerror (code));
-#endif
-
}
#endif
print " * This file is automatically generated; please do not edit it." > outfile
print " */" > outfile
print "" > outfile
- print "#if defined(macintosh) || (defined(__MACH__) && defined(__APPLE__))" > outfile
- print "#include <KerberosComErr/KerberosComErr.h>" > outfile
- print "#else" > outfile
print "#include <com_err.h>" > outfile
- print "#endif" > outfile
print "" > outfile
}
print "#if !defined(_WIN32) && !defined(macintosh) && !(defined(__MACH__) && defined(__APPLE__))" > outfile
print "/* for compatibility with older versions... */" > outfile
print "extern void initialize_" table_name "_error_table () /*@modifies internalState@*/;" > outfile
- print "#define init_" table_name "_err_tbl initialize_" table_name "_error_table" > outfile
- print "#define " table_name "_err_base ERROR_TABLE_BASE_" table_name > outfile
print "#else" > outfile
print "#define initialize_" table_name "_error_table()" > outfile
print "#endif" > outfile
+ print "" > outfile
+ print "#if !defined(_WIN32)" > outfile
+ print "#define init_" table_name "_err_tbl initialize_" table_name "_error_table" > outfile
+ print "#define " table_name "_err_base ERROR_TABLE_BASE_" table_name > outfile
+ print "#endif" > outfile
}