mirror of
https://github.com/autc04/Retro68.git
synced 2025-02-02 14:31:18 +00:00
Pascal Strings (using C++11 user-defined string literals)
This commit is contained in:
parent
2ddb1c1849
commit
dd1fe214cd
@ -16,4 +16,11 @@ public:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
inline const unsigned char* operator"" _pstr(const char*p, size_t n)
|
||||||
|
{
|
||||||
|
unsigned char *pp = reinterpret_cast<unsigned char*>(const_cast<char*>(p));
|
||||||
|
pp[0] = n-1;
|
||||||
|
return pp;
|
||||||
|
}
|
||||||
|
#define PSTR(s) ("*" s ## _pstr)
|
||||||
|
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
#include <Events.h>
|
#include <Events.h>
|
||||||
#include <Fonts.h>
|
#include <Fonts.h>
|
||||||
|
|
||||||
|
#include "MacUtils.h"
|
||||||
#include "Console.h"
|
#include "Console.h"
|
||||||
|
|
||||||
QDGlobals qd;
|
QDGlobals qd;
|
||||||
@ -56,7 +57,7 @@ int main(int argc, char** argv)
|
|||||||
|
|
||||||
Rect r;
|
Rect r;
|
||||||
SetRect(&r, qd.screenBits.bounds.left + 5, qd.screenBits.bounds.top + 45, qd.screenBits.bounds.right - 5, qd.screenBits.bounds.bottom -5);
|
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);
|
SetPort(win);
|
||||||
EraseRect(&win->portRect);
|
EraseRect(&win->portRect);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user