2014-02-10 09:10:30 +08:00
|
|
|
/*************************************************************************/
|
|
|
|
/* os_osx.mm */
|
|
|
|
/*************************************************************************/
|
|
|
|
/* This file is part of: */
|
|
|
|
/* GODOT ENGINE */
|
2017-08-27 20:16:55 +08:00
|
|
|
/* https://godotengine.org */
|
2014-02-10 09:10:30 +08:00
|
|
|
/*************************************************************************/
|
2020-01-01 18:16:22 +08:00
|
|
|
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
|
|
|
|
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
|
2014-02-10 09:10:30 +08:00
|
|
|
/* */
|
|
|
|
/* Permission is hereby granted, free of charge, to any person obtaining */
|
|
|
|
/* a copy of this software and associated documentation files (the */
|
|
|
|
/* "Software"), to deal in the Software without restriction, including */
|
|
|
|
/* without limitation the rights to use, copy, modify, merge, publish, */
|
|
|
|
/* distribute, sublicense, and/or sell copies of the Software, and to */
|
|
|
|
/* permit persons to whom the Software is furnished to do so, subject to */
|
|
|
|
/* the following conditions: */
|
|
|
|
/* */
|
|
|
|
/* The above copyright notice and this permission notice shall be */
|
|
|
|
/* included in all copies or substantial portions of the Software. */
|
|
|
|
/* */
|
|
|
|
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
|
|
|
|
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
|
|
|
|
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
|
|
|
|
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
|
|
|
|
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
|
|
|
|
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
|
|
|
|
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
|
|
|
/*************************************************************************/
|
2018-01-05 07:50:27 +08:00
|
|
|
|
2017-04-09 20:18:49 +08:00
|
|
|
#include "os_osx.h"
|
|
|
|
|
2018-09-12 00:13:45 +08:00
|
|
|
#include "core/version_generated.gen.h"
|
2019-06-23 00:34:26 +08:00
|
|
|
|
2020-03-08 00:02:54 +08:00
|
|
|
#include "dir_access_osx.h"
|
|
|
|
#include "display_server_osx.h"
|
2017-04-09 20:18:49 +08:00
|
|
|
#include "main/main.h"
|
2019-06-23 00:34:26 +08:00
|
|
|
|
2018-01-05 03:36:44 +08:00
|
|
|
#include <dlfcn.h>
|
2017-04-09 20:18:49 +08:00
|
|
|
#include <libproc.h>
|
2020-03-08 00:02:54 +08:00
|
|
|
#include <mach-o/dyld.h>
|
|
|
|
#include <os/log.h>
|
2017-07-29 00:06:48 +08:00
|
|
|
|
2020-03-08 00:02:54 +08:00
|
|
|
/*************************************************************************/
|
|
|
|
/* OSXTerminalLogger */
|
|
|
|
/*************************************************************************/
|
2017-07-29 00:06:48 +08:00
|
|
|
|
2020-03-08 00:02:54 +08:00
|
|
|
class OSXTerminalLogger : public StdLogger {
|
|
|
|
public:
|
|
|
|
virtual void log_error(const char *p_function, const char *p_file, int p_line, const char *p_code, const char *p_rationale, ErrorType p_type = ERR_ERROR) {
|
|
|
|
if (!should_log(true)) {
|
|
|
|
return;
|
2017-07-29 00:06:48 +08:00
|
|
|
}
|
|
|
|
|
2020-03-08 00:02:54 +08:00
|
|
|
const char *err_details;
|
|
|
|
if (p_rationale && p_rationale[0])
|
|
|
|
err_details = p_rationale;
|
|
|
|
else
|
|
|
|
err_details = p_code;
|
2019-06-23 00:34:26 +08:00
|
|
|
|
2020-03-08 00:02:54 +08:00
|
|
|
switch (p_type) {
|
|
|
|
case ERR_WARNING:
|
2020-04-27 02:17:10 +08:00
|
|
|
os_log_info(OS_LOG_DEFAULT,
|
|
|
|
"WARNING: %{public}s\nat: %{public}s (%{public}s:%i)",
|
|
|
|
err_details, p_function, p_file, p_line);
|
2020-03-08 00:02:54 +08:00
|
|
|
logf_error("\E[1;33mWARNING:\E[0;93m %s\n", err_details);
|
|
|
|
logf_error("\E[0;90m at: %s (%s:%i)\E[0m\n", p_function, p_file, p_line);
|
|
|
|
break;
|
|
|
|
case ERR_SCRIPT:
|
2020-04-27 02:17:10 +08:00
|
|
|
os_log_error(OS_LOG_DEFAULT,
|
|
|
|
"SCRIPT ERROR: %{public}s\nat: %{public}s (%{public}s:%i)",
|
|
|
|
err_details, p_function, p_file, p_line);
|
2020-03-08 00:02:54 +08:00
|
|
|
logf_error("\E[1;35mSCRIPT ERROR:\E[0;95m %s\n", err_details);
|
|
|
|
logf_error("\E[0;90m at: %s (%s:%i)\E[0m\n", p_function, p_file, p_line);
|
|
|
|
break;
|
|
|
|
case ERR_SHADER:
|
2020-04-27 02:17:10 +08:00
|
|
|
os_log_error(OS_LOG_DEFAULT,
|
|
|
|
"SHADER ERROR: %{public}s\nat: %{public}s (%{public}s:%i)",
|
|
|
|
err_details, p_function, p_file, p_line);
|
2020-03-08 00:02:54 +08:00
|
|
|
logf_error("\E[1;36mSHADER ERROR:\E[0;96m %s\n", err_details);
|
|
|
|
logf_error("\E[0;90m at: %s (%s:%i)\E[0m\n", p_function, p_file, p_line);
|
|
|
|
break;
|
|
|
|
case ERR_ERROR:
|
|
|
|
default:
|
2020-04-27 02:17:10 +08:00
|
|
|
os_log_error(OS_LOG_DEFAULT,
|
|
|
|
"ERROR: %{public}s\nat: %{public}s (%{public}s:%i)",
|
|
|
|
err_details, p_function, p_file, p_line);
|
2020-03-08 00:02:54 +08:00
|
|
|
logf_error("\E[1;31mERROR:\E[0;91m %s\n", err_details);
|
|
|
|
logf_error("\E[0;90m at: %s (%s:%i)\E[0m\n", p_function, p_file, p_line);
|
|
|
|
break;
|
2019-01-23 00:17:39 +08:00
|
|
|
}
|
2017-07-26 21:29:48 +08:00
|
|
|
}
|
2015-04-02 12:32:02 +08:00
|
|
|
};
|
|
|
|
|
2020-03-08 00:02:54 +08:00
|
|
|
/*************************************************************************/
|
|
|
|
/* OS_OSX */
|
|
|
|
/*************************************************************************/
|
2017-08-07 19:09:56 +08:00
|
|
|
|
2018-01-20 23:17:39 +08:00
|
|
|
String OS_OSX::get_unique_id() const {
|
2020-03-08 00:02:54 +08:00
|
|
|
static String serial_number;
|
2018-01-20 23:17:39 +08:00
|
|
|
|
2020-03-08 00:02:54 +08:00
|
|
|
if (serial_number.empty()) {
|
|
|
|
io_service_t platformExpert = IOServiceGetMatchingService(kIOMasterPortDefault, IOServiceMatching("IOPlatformExpertDevice"));
|
|
|
|
CFStringRef serialNumberAsCFString = NULL;
|
|
|
|
if (platformExpert) {
|
|
|
|
serialNumberAsCFString = (CFStringRef)IORegistryEntryCreateCFProperty(platformExpert, CFSTR(kIOPlatformSerialNumberKey), kCFAllocatorDefault, 0);
|
|
|
|
IOObjectRelease(platformExpert);
|
|
|
|
}
|
2015-04-02 12:32:02 +08:00
|
|
|
|
2020-03-08 00:02:54 +08:00
|
|
|
NSString *serialNumberAsNSString = nil;
|
|
|
|
if (serialNumberAsCFString) {
|
|
|
|
serialNumberAsNSString = [NSString stringWithString:(NSString *)serialNumberAsCFString];
|
|
|
|
CFRelease(serialNumberAsCFString);
|
|
|
|
}
|
2015-04-02 12:32:02 +08:00
|
|
|
|
2020-03-08 00:02:54 +08:00
|
|
|
serial_number = [serialNumberAsNSString UTF8String];
|
|
|
|
}
|
2014-02-10 09:10:30 +08:00
|
|
|
|
2020-03-08 00:02:54 +08:00
|
|
|
return serial_number;
|
2014-02-10 09:10:30 +08:00
|
|
|
}
|
|
|
|
|
2020-03-08 00:02:54 +08:00
|
|
|
void OS_OSX::initialize_core() {
|
|
|
|
OS_Unix::initialize_core();
|
2018-01-31 03:39:53 +08:00
|
|
|
|
2020-03-08 00:02:54 +08:00
|
|
|
DirAccess::make_default<DirAccessOSX>(DirAccess::ACCESS_RESOURCES);
|
|
|
|
DirAccess::make_default<DirAccessOSX>(DirAccess::ACCESS_USERDATA);
|
|
|
|
DirAccess::make_default<DirAccessOSX>(DirAccess::ACCESS_FILESYSTEM);
|
2018-01-31 03:39:53 +08:00
|
|
|
}
|
|
|
|
|
2020-03-08 00:02:54 +08:00
|
|
|
void OS_OSX::initialize_joypads() {
|
2020-04-28 21:19:37 +08:00
|
|
|
joypad_osx = memnew(JoypadOSX(Input::get_singleton()));
|
2018-01-31 03:39:53 +08:00
|
|
|
}
|
|
|
|
|
2020-03-08 00:02:54 +08:00
|
|
|
void OS_OSX::initialize() {
|
|
|
|
crash_handler.initialize();
|
|
|
|
|
|
|
|
initialize_core();
|
|
|
|
//ensure_user_data_dir();
|
2019-11-28 20:41:07 +08:00
|
|
|
}
|
|
|
|
|
2020-03-08 00:02:54 +08:00
|
|
|
void OS_OSX::finalize() {
|
|
|
|
#ifdef COREMIDI_ENABLED
|
|
|
|
midi_driver.close();
|
|
|
|
#endif
|
2016-07-21 23:30:20 +08:00
|
|
|
|
2020-03-08 00:02:54 +08:00
|
|
|
delete_main_loop();
|
2017-12-11 02:38:26 +08:00
|
|
|
|
2020-03-08 00:02:54 +08:00
|
|
|
memdelete(joypad_osx);
|
2017-12-11 02:38:26 +08:00
|
|
|
}
|
|
|
|
|
2020-03-08 00:02:54 +08:00
|
|
|
void OS_OSX::set_main_loop(MainLoop *p_main_loop) {
|
|
|
|
main_loop = p_main_loop;
|
2017-12-11 02:38:26 +08:00
|
|
|
}
|
|
|
|
|
2020-03-08 00:02:54 +08:00
|
|
|
void OS_OSX::delete_main_loop() {
|
|
|
|
if (!main_loop)
|
|
|
|
return;
|
|
|
|
memdelete(main_loop);
|
|
|
|
main_loop = NULL;
|
|
|
|
}
|
2017-12-11 02:38:26 +08:00
|
|
|
|
2020-03-08 00:02:54 +08:00
|
|
|
String OS_OSX::get_name() const {
|
|
|
|
return "macOS";
|
|
|
|
}
|
2017-06-28 00:13:03 +08:00
|
|
|
|
2020-03-08 00:02:54 +08:00
|
|
|
Error OS_OSX::open_dynamic_library(const String p_path, void *&p_library_handle, bool p_also_set_library_path) {
|
|
|
|
String path = p_path;
|
2017-06-28 00:13:03 +08:00
|
|
|
|
2020-03-08 00:02:54 +08:00
|
|
|
if (!FileAccess::exists(path)) {
|
|
|
|
//this code exists so gdnative can load .dylib files from within the executable path
|
|
|
|
path = get_executable_path().get_base_dir().plus_file(p_path.get_file());
|
2017-06-28 00:13:03 +08:00
|
|
|
}
|
2017-07-03 09:44:42 +08:00
|
|
|
|
2020-03-08 00:02:54 +08:00
|
|
|
if (!FileAccess::exists(path)) {
|
|
|
|
//this code exists so gdnative can load .dylib files from a standard macOS location
|
|
|
|
path = get_executable_path().get_base_dir().plus_file("../Frameworks").plus_file(p_path.get_file());
|
|
|
|
}
|
2017-07-03 09:44:42 +08:00
|
|
|
|
2020-03-08 00:02:54 +08:00
|
|
|
p_library_handle = dlopen(path.utf8().get_data(), RTLD_NOW);
|
|
|
|
ERR_FAIL_COND_V_MSG(!p_library_handle, ERR_CANT_OPEN, "Can't open dynamic library: " + p_path + ", error: " + dlerror() + ".");
|
|
|
|
return OK;
|
2017-06-28 00:13:03 +08:00
|
|
|
}
|
|
|
|
|
2020-03-08 00:02:54 +08:00
|
|
|
MainLoop *OS_OSX::get_main_loop() const {
|
|
|
|
return main_loop;
|
2017-06-28 00:13:03 +08:00
|
|
|
}
|
|
|
|
|
2020-03-08 00:02:54 +08:00
|
|
|
String OS_OSX::get_config_path() const {
|
|
|
|
if (has_environment("XDG_CONFIG_HOME")) {
|
|
|
|
return get_environment("XDG_CONFIG_HOME");
|
|
|
|
} else if (has_environment("HOME")) {
|
|
|
|
return get_environment("HOME").plus_file("Library/Application Support");
|
2014-02-10 09:10:30 +08:00
|
|
|
} else {
|
2020-03-08 00:02:54 +08:00
|
|
|
return ".";
|
2014-02-10 09:10:30 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-03-08 00:02:54 +08:00
|
|
|
String OS_OSX::get_data_path() const {
|
|
|
|
if (has_environment("XDG_DATA_HOME")) {
|
|
|
|
return get_environment("XDG_DATA_HOME");
|
|
|
|
} else {
|
|
|
|
return get_config_path();
|
2015-01-08 15:26:27 +08:00
|
|
|
}
|
|
|
|
}
|
2017-04-09 19:22:40 +08:00
|
|
|
|
2020-03-08 00:02:54 +08:00
|
|
|
String OS_OSX::get_cache_path() const {
|
|
|
|
if (has_environment("XDG_CACHE_HOME")) {
|
|
|
|
return get_environment("XDG_CACHE_HOME");
|
|
|
|
} else if (has_environment("HOME")) {
|
|
|
|
return get_environment("HOME").plus_file("Library/Caches");
|
|
|
|
} else {
|
|
|
|
return get_config_path();
|
2015-01-08 15:26:27 +08:00
|
|
|
}
|
|
|
|
}
|
2014-02-10 09:10:30 +08:00
|
|
|
|
2020-03-08 00:02:54 +08:00
|
|
|
String OS_OSX::get_bundle_resource_dir() const {
|
|
|
|
NSBundle *main = [NSBundle mainBundle];
|
|
|
|
NSString *resourcePath = [main resourcePath];
|
2014-02-10 09:10:30 +08:00
|
|
|
|
2020-03-08 00:02:54 +08:00
|
|
|
char *utfs = strdup([resourcePath UTF8String]);
|
|
|
|
String ret;
|
|
|
|
ret.parse_utf8(utfs);
|
|
|
|
free(utfs);
|
2019-03-04 06:52:18 +08:00
|
|
|
|
2020-03-08 00:02:54 +08:00
|
|
|
return ret;
|
2014-02-10 09:10:30 +08:00
|
|
|
}
|
|
|
|
|
2020-03-08 00:02:54 +08:00
|
|
|
// Get properly capitalized engine name for system paths
|
|
|
|
String OS_OSX::get_godot_dir_name() const {
|
|
|
|
return String(VERSION_SHORT_NAME).capitalize();
|
|
|
|
}
|
2018-01-10 19:22:28 +08:00
|
|
|
|
2020-03-08 00:02:54 +08:00
|
|
|
String OS_OSX::get_system_dir(SystemDir p_dir) const {
|
|
|
|
NSSearchPathDirectory id;
|
|
|
|
bool found = true;
|
2018-01-10 19:22:28 +08:00
|
|
|
|
2020-03-08 00:02:54 +08:00
|
|
|
switch (p_dir) {
|
|
|
|
case SYSTEM_DIR_DESKTOP: {
|
|
|
|
id = NSDesktopDirectory;
|
|
|
|
} break;
|
|
|
|
case SYSTEM_DIR_DOCUMENTS: {
|
|
|
|
id = NSDocumentDirectory;
|
|
|
|
} break;
|
|
|
|
case SYSTEM_DIR_DOWNLOADS: {
|
|
|
|
id = NSDownloadsDirectory;
|
|
|
|
} break;
|
|
|
|
case SYSTEM_DIR_MOVIES: {
|
|
|
|
id = NSMoviesDirectory;
|
|
|
|
} break;
|
|
|
|
case SYSTEM_DIR_MUSIC: {
|
|
|
|
id = NSMusicDirectory;
|
|
|
|
} break;
|
|
|
|
case SYSTEM_DIR_PICTURES: {
|
|
|
|
id = NSPicturesDirectory;
|
|
|
|
} break;
|
|
|
|
default: {
|
|
|
|
found = false;
|
|
|
|
}
|
|
|
|
}
|
2018-01-10 19:22:28 +08:00
|
|
|
|
2020-03-08 00:02:54 +08:00
|
|
|
String ret;
|
|
|
|
if (found) {
|
|
|
|
NSArray *paths = NSSearchPathForDirectoriesInDomains(id, NSUserDomainMask, YES);
|
|
|
|
if (paths && [paths count] >= 1) {
|
|
|
|
char *utfs = strdup([[paths firstObject] UTF8String]);
|
|
|
|
ret.parse_utf8(utfs);
|
|
|
|
free(utfs);
|
2018-01-10 19:22:28 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-03-08 00:02:54 +08:00
|
|
|
return ret;
|
2018-01-10 19:22:28 +08:00
|
|
|
}
|
|
|
|
|
2020-03-08 00:02:54 +08:00
|
|
|
Error OS_OSX::shell_open(String p_uri) {
|
2020-07-04 12:00:48 +08:00
|
|
|
NSString *string = [NSString stringWithUTF8String:p_uri.utf8().get_data()];
|
|
|
|
NSURL *uri = [[NSURL alloc] initWithString:string];
|
|
|
|
// Escape special characters in filenames
|
|
|
|
if (!uri || !uri.scheme || [uri.scheme isEqual:@"file"]) {
|
|
|
|
uri = [[NSURL alloc] initWithString:[string stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLFragmentAllowedCharacterSet]]];
|
|
|
|
}
|
|
|
|
[[NSWorkspace sharedWorkspace] openURL:uri];
|
2020-03-08 00:02:54 +08:00
|
|
|
return OK;
|
|
|
|
}
|
2017-05-22 17:17:14 +08:00
|
|
|
|
2020-03-08 00:02:54 +08:00
|
|
|
String OS_OSX::get_locale() const {
|
|
|
|
NSString *locale_code = [[NSLocale preferredLanguages] objectAtIndex:0];
|
|
|
|
return [locale_code UTF8String];
|
2014-02-10 09:10:30 +08:00
|
|
|
}
|
|
|
|
|
2020-03-08 00:02:54 +08:00
|
|
|
String OS_OSX::get_executable_path() const {
|
|
|
|
int ret;
|
|
|
|
pid_t pid;
|
|
|
|
char pathbuf[PROC_PIDPATHINFO_MAXSIZE];
|
|
|
|
|
|
|
|
pid = getpid();
|
|
|
|
ret = proc_pidpath(pid, pathbuf, sizeof(pathbuf));
|
|
|
|
if (ret <= 0) {
|
|
|
|
return OS::get_executable_path();
|
|
|
|
} else {
|
|
|
|
String path;
|
|
|
|
path.parse_utf8(pathbuf);
|
2017-12-14 19:59:46 +08:00
|
|
|
|
2020-03-08 00:02:54 +08:00
|
|
|
return path;
|
|
|
|
}
|
2017-12-14 19:59:46 +08:00
|
|
|
}
|
|
|
|
|
2014-02-10 09:10:30 +08:00
|
|
|
void OS_OSX::run() {
|
|
|
|
force_quit = false;
|
|
|
|
|
|
|
|
if (!main_loop)
|
|
|
|
return;
|
|
|
|
|
|
|
|
main_loop->init();
|
|
|
|
|
2018-01-15 16:20:45 +08:00
|
|
|
bool quit = false;
|
|
|
|
while (!force_quit && !quit) {
|
|
|
|
@try {
|
2020-03-08 00:02:54 +08:00
|
|
|
if (DisplayServer::get_singleton()) {
|
|
|
|
DisplayServer::get_singleton()->process_events(); // get rid of pending events
|
|
|
|
}
|
2018-01-15 16:20:45 +08:00
|
|
|
joypad_osx->process_joypads();
|
|
|
|
|
2020-07-14 02:13:38 +08:00
|
|
|
if (Main::iteration()) {
|
2018-01-15 16:20:45 +08:00
|
|
|
quit = true;
|
|
|
|
}
|
|
|
|
} @catch (NSException *exception) {
|
2019-11-07 00:03:04 +08:00
|
|
|
ERR_PRINT("NSException: " + String([exception reason].UTF8String));
|
2018-01-15 16:20:45 +08:00
|
|
|
}
|
2014-02-10 09:10:30 +08:00
|
|
|
};
|
|
|
|
main_loop->finish();
|
|
|
|
}
|
|
|
|
|
2017-09-25 21:15:11 +08:00
|
|
|
Error OS_OSX::move_to_trash(const String &p_path) {
|
|
|
|
NSFileManager *fm = [NSFileManager defaultManager];
|
|
|
|
NSURL *url = [NSURL fileURLWithPath:@(p_path.utf8().get_data())];
|
|
|
|
NSError *err;
|
|
|
|
|
|
|
|
if (![fm trashItemAtURL:url resultingItemURL:nil error:&err]) {
|
2019-11-07 00:03:04 +08:00
|
|
|
ERR_PRINT("trashItemAtURL error: " + String(err.localizedDescription.UTF8String));
|
2017-09-25 21:15:11 +08:00
|
|
|
return FAILED;
|
|
|
|
}
|
|
|
|
|
|
|
|
return OK;
|
|
|
|
}
|
|
|
|
|
2014-02-10 09:10:30 +08:00
|
|
|
OS_OSX::OS_OSX() {
|
2017-04-09 20:18:49 +08:00
|
|
|
main_loop = NULL;
|
2020-03-08 00:02:54 +08:00
|
|
|
force_quit = false;
|
2017-09-22 13:56:02 +08:00
|
|
|
|
2017-11-21 17:35:01 +08:00
|
|
|
Vector<Logger *> loggers;
|
|
|
|
loggers.push_back(memnew(OSXTerminalLogger));
|
|
|
|
_set_logger(memnew(CompositeLogger(loggers)));
|
2018-01-12 22:38:19 +08:00
|
|
|
|
2018-10-25 21:59:26 +08:00
|
|
|
#ifdef COREAUDIO_ENABLED
|
2018-03-05 01:18:05 +08:00
|
|
|
AudioDriverManager::add_driver(&audio_driver);
|
2018-10-25 21:59:26 +08:00
|
|
|
#endif
|
2020-03-08 00:02:54 +08:00
|
|
|
|
|
|
|
DisplayServerOSX::register_osx_driver();
|
2014-02-10 09:10:30 +08:00
|
|
|
}
|
2017-07-20 04:00:46 +08:00
|
|
|
|
|
|
|
bool OS_OSX::_check_internal_feature_support(const String &p_feature) {
|
2019-02-26 22:58:47 +08:00
|
|
|
return p_feature == "pc";
|
2017-07-20 04:00:46 +08:00
|
|
|
}
|
2017-09-08 09:01:49 +08:00
|
|
|
|
|
|
|
void OS_OSX::disable_crash_handler() {
|
|
|
|
crash_handler.disable();
|
|
|
|
}
|
|
|
|
|
|
|
|
bool OS_OSX::is_disable_crash_handler() const {
|
|
|
|
return crash_handler.is_disabled();
|
|
|
|
}
|