diff --git a/App2/MacUtils.h b/App2/MacUtils.h index 9a62af6fa0..230ab88922 100644 --- a/App2/MacUtils.h +++ b/App2/MacUtils.h @@ -16,4 +16,11 @@ public: } }; +inline const unsigned char* operator"" _pstr(const char*p, size_t n) +{ + unsigned char *pp = reinterpret_cast(const_cast(p)); + pp[0] = n-1; + return pp; +} +#define PSTR(s) ("*" s ## _pstr) diff --git a/App2/test.cc b/App2/test.cc index 2392270156..4cc55ae828 100644 --- a/App2/test.cc +++ b/App2/test.cc @@ -11,6 +11,7 @@ #include #include +#include "MacUtils.h" #include "Console.h" QDGlobals qd; @@ -56,7 +57,7 @@ int main(int argc, char** argv) Rect r; SetRect(&r, qd.screenBits.bounds.left + 5, qd.screenBits.bounds.top + 45, qd.screenBits.bounds.right - 5, qd.screenBits.bounds.bottom -5); - win = NewWindow(NULL, &r, (unsigned char*)"", true, 0, (WindowPtr)-1, false, 0); + win = NewWindow(NULL, &r, PSTR("Retro68 Console"), true, 0, (WindowPtr)-1, false, 0); SetPort(win); EraseRect(&win->portRect);