Rev | Line | |
---|
[5487] | 1 | #ifdef HAVE_CONFIG_H |
---|
| 2 | # include "config.h" |
---|
| 3 | #endif |
---|
| 4 | |
---|
| 5 | #include <iostream> |
---|
| 6 | #include <string> |
---|
| 7 | #ifdef HAVE_WINDOWS_H |
---|
| 8 | # define WIN32_LEAN_AND_MEAN |
---|
| 9 | # include <windows.h> |
---|
| 10 | #endif |
---|
| 11 | #include "output.hh" |
---|
| 12 | |
---|
| 13 | using std::cout; |
---|
| 14 | using std::endl; |
---|
| 15 | using std::string; |
---|
| 16 | |
---|
| 17 | void output_string(const string &str){ |
---|
| 18 | /* Better to have some kind of HAVE_MESSAGEBOX, but that's not |
---|
| 19 | possible since: |
---|
| 20 | 1. MessageBox is a macro that is defined to MessageBoxA or MessageBoxW. |
---|
| 21 | 2. MessageBox{A,W} are called with the stdcall calling |
---|
| 22 | convention, mangling the names based on the parameters meaning |
---|
| 23 | that autoconf can't get this right. |
---|
| 24 | 3. We can't define the full prototype for MessageBox{A,W} since |
---|
| 25 | the parameters are typedef'd out the wazoo and our guess could |
---|
| 26 | well break on 64-bit Windows. */ |
---|
| 27 | #ifdef HAVE_WINDOWS_H |
---|
| 28 | MessageBox(NULL, str.c_str(), "Message", MB_OK|MB_ICONEXCLAMATION); |
---|
| 29 | #else |
---|
| 30 | cout << str << endl; |
---|
| 31 | #endif |
---|
| 32 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.