diff --git a/toolbox/os_gestalt.cpp b/toolbox/os_gestalt.cpp index bc781fa..263d40e 100644 --- a/toolbox/os_gestalt.cpp +++ b/toolbox/os_gestalt.cpp @@ -32,6 +32,7 @@ #include #include #include +#include #include #include @@ -55,6 +56,8 @@ using ToolBox::Log; +#define FOUR_CHAR_CODE(x) x + namespace OS { enum @@ -65,9 +68,45 @@ namespace OS { gestaltLocationErr = -5553, }; + + enum { + gestaltOSAttr = FOUR_CHAR_CODE('os '), /* o/s attributes */ + gestaltSysZoneGrowable = 0, /* system heap is growable */ + gestaltLaunchCanReturn = 1, /* can return from launch */ + gestaltLaunchFullFileSpec = 2, /* can launch from full file spec */ + gestaltLaunchControl = 3, /* launch control support available */ + gestaltTempMemSupport = 4, /* temp memory support */ + gestaltRealTempMemory = 5, /* temp memory handles are real */ + gestaltTempMemTracked = 6, /* temporary memory handles are tracked */ + gestaltIPCSupport = 7, /* IPC support is present */ + gestaltSysDebuggerSupport = 8, /* system debugger support is present */ + gestaltNativeProcessMgrBit = 19 /* the process manager itself is native */ + }; + + + template + struct make_bitmask; + + template<> + struct make_bitmask<> : public std::integral_constant + {}; + + template + struct make_bitmask : + public std::integral_constant::value > + {}; + + + + std::map GestaltMap = { {'alis', 1}, // Alias Manager {'tmgr', 2}, // Time Manager (2 = revised, 3 = extended.) + { + // enable temp memory for codewarrior + gestaltOSAttr, + make_bitmask::value + }, }; uint16_t Gestalt(uint16_t trap)