peter1138@2847: /* $Id$ */ peter1138@2847: bjarni@2188: #ifndef MACOS_H bjarni@2188: #define MACOS_H bjarni@2188: bjarni@3127: /* bjarni@3127: * Functions to show the popup window bjarni@3127: * use ShowMacDialog when you want to control title, message and text on the button bjarni@3127: * ShowMacAssertDialog is used by assert bjarni@3127: * ShowMacErrorDialog should be used when an unrecoverable error shows up. It only contains the title, which will should tell what went wrong rubidium@4434: * the function then adds text that tells the user to update and then report the bug if it's present in the newest version rubidium@4434: * It also quits in a nice way since we call it when we know something happened that will crash OpenTTD (like a needed pointer turns out to be NULL or similar) bjarni@3127: */ bjarni@2188: void ShowMacDialog ( const char *title, const char *message, const char *buttonLabel ); bjarni@2223: void ShowMacAssertDialog ( const char *function, const char *file, const int line, const char *expression ); bjarni@3127: void ShowMacErrorDialog(const char *error); bjarni@2188: bjarni@2223: // Since MacOS X users will never see an assert unless they started the game from a terminal bjarni@2223: // we're using a custom assert(e) macro. bjarni@2223: #undef assert bjarni@2223: bjarni@2223: #ifdef NDEBUG bjarni@2223: #define assert(e) ((void)0) bjarni@2223: #else bjarni@2223: bjarni@2223: #define assert(e) \ bjarni@2223: (__builtin_expect(!(e), 0) ? ShowMacAssertDialog ( __func__, __FILE__, __LINE__, #e ): (void)0 ) bjarni@2223: #endif bjarni@2223: bjarni@2223: #endif /* MACOS_H */