diff --git a/qse/include/qse/conf-inf.h b/qse/include/qse/conf-inf.h index 96237e6c..41e8a7ce 100644 --- a/qse/include/qse/conf-inf.h +++ b/qse/include/qse/conf-inf.h @@ -1,8 +1,8 @@ #ifndef _QSE_CONF_INF_H_ #define _QSE_CONF_INF_H_ -/* change this information whenever you update - * package version in configure.ac */ +/* This file is used for non-autoconf based build systems. + * Change this information whenever you update package version in configure.ac */ #define QSE_PACKAGE_VERSION "0.6.0" #define QSE_PACKAGE_VERSION_MAJOR 0 diff --git a/qse/lib/cmn/assert.c b/qse/lib/cmn/assert.c index 64e39de7..2eeae336 100644 --- a/qse/lib/cmn/assert.c +++ b/qse/lib/cmn/assert.c @@ -45,6 +45,11 @@ # include /* (SYS$...) */ # include /* (SS$...) */ # include /* (lib$...) */ +#elif defined(macintosh) +# include +# include +# include +# include #else # include "syscall.h" #endif @@ -91,10 +96,41 @@ void qse_assert_failed ( const qse_char_t* expr, const qse_char_t* desc, const qse_char_t* file, qse_size_t line) { +#if defined(macintosh) + /* note 'desc' is not used for macintosh at this moment. + * TODO: include 'desc' in the message */ + + Str255 ptitle; + Str255 ptext; + SInt16 res; + + { + qse_mchar_t tmp[256]; + + #if defined(QSE_CHAR_IS_MCHAR) + qse_mbsxfmt (tmp, QSE_COUNTOF(tmp), QSE_MT("ASSERTION FAILURE AT FILE %hs LINE %lu"), file, (unsigned long)line); + #else + qse_mbsxfmt (tmp, QSE_COUNTOF(tmp), QSE_MT("ASSERTION FAILURE AT FILE %ls LINE %lu"), file, (unsigned long)line); + #endif + CopyCStringToPascal (tmp, ptitle); + + #if defined(QSE_CHAR_IS_MCHAR) + CopyCStringToPascal (expr, ptext); + #else + qse_mbsxfmt (tmp, QSE_COUNTOF(tmp), QSE_MT("%ls"), expr); + CopyCStringToPascal (tmp, ptext); + #endif + } + + InitCursor (); + StandardAlert (kAlertStopAlert, ptitle, ptext, nil, &res); + +#else /* macintosh */ + #if defined(HAVE_BACKTRACE) - void *btarray[128]; + void* btarray[128]; qse_size_t btsize, i; - char **btsyms; + char** btsyms; #endif qse_sio_t* sio, siobuf; @@ -158,6 +194,7 @@ void qse_assert_failed ( qse_sio_putmbs (sio, QSE_MT("================================================================================\n")); qse_sio_flush (sio); qse_sio_fini (sio); +#endif /* macintosh */ #if defined(_WIN32) ExitProcess (249); @@ -176,6 +213,8 @@ void qse_assert_failed ( /* this won't be reached since lib$stop() terminates the process */ sys$exit (SS$_ABORT); /* this condition code can be shown with * 'show symbol $status' from the command-line. */ +#elif defined(macintosh) + ExitToShell (); #else QSE_KILL (QSE_GETPID(), SIGABRT); QSE_EXIT (1);