mirror of
https://github.com/autc04/Retro68.git
synced 2024-10-03 20:56:36 +00:00
28 lines
438 B
C++
28 lines
438 B
C++
#include <Quickdraw.h>
|
|
#include <stdlib.h>
|
|
|
|
class PortSetter
|
|
{
|
|
GrafPtr save;
|
|
public:
|
|
PortSetter(GrafPtr port)
|
|
{
|
|
::GetPort(&save);
|
|
::SetPort(port);
|
|
}
|
|
|
|
~PortSetter()
|
|
{
|
|
::SetPort(save);
|
|
}
|
|
};
|
|
|
|
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)
|
|
|