Skip to content

Commit 9d5e53b

Browse files
committed
fix: conflicting enum id on iOS
1 parent 29b9bd6 commit 9d5e53b

3 files changed

Lines changed: 7 additions & 12 deletions

File tree

common/rnexecutorch/Log.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ namespace rnexecutorch {
1515
#ifdef __ANDROID__
1616
android_LogPriority androidLogLevel(LOG_LEVEL logLevel) {
1717
switch (logLevel) {
18-
case LOG_LEVEL::INFO:
18+
case LOG_LEVEL::Info:
1919
default:
2020
return ANDROID_LOG_INFO;
21-
case LOG_LEVEL::ERROR:
21+
case LOG_LEVEL::Error:
2222
return ANDROID_LOG_ERROR;
23-
case LOG_LEVEL::DEBUG:
23+
case LOG_LEVEL::Debug:
2424
return ANDROID_LOG_DEBUG;
2525
}
2626
}
@@ -49,14 +49,14 @@ void log(LOG_LEVEL logLevel, const char *fmt, ...) {
4949
#ifdef __APPLE__
5050

5151
switch (logLevel) {
52-
case LOG_LEVEL::INFO:
52+
case LOG_LEVEL::Info:
5353
default:
5454
os_log_info(OS_LOG_DEFAULT, "%s", buf);
5555
break;
56-
case LOG_LEVEL::ERROR:
56+
case LOG_LEVEL::Error:
5757
os_log_error(OS_LOG_DEFAULT, "%s", buf);
5858
break;
59-
case LOG_LEVEL::DEBUG:
59+
case LOG_LEVEL::Debug:
6060
os_log_debug(OS_LOG_DEFAULT, "%s", buf);
6161
break;
6262
}

common/rnexecutorch/Log.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace rnexecutorch {
44

5-
enum class LOG_LEVEL { INFO, ERROR, DEBUG };
5+
enum class LOG_LEVEL { Info, Error, Debug };
66

77
// const char* instead of const std::string& as va_start doesn't take references
88
void log(LOG_LEVEL logLevel, const char *fmt, ...);

common/rnexecutorch/RnExecutorchInstaller.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,10 @@ jsi::Function RnExecutorchInstaller::loadStyleTransfer(
4040
// version:
4141
// https://github.com/facebook/react-native/commit/3132cc88dd46f95898a756456bebeeb6c248f20e
4242
throw jsi::JSError(runtime, e.what());
43-
return jsi::Value();
4443
} catch (const std::exception &e) {
4544
throw jsi::JSError(runtime, e.what());
46-
return jsi::Value();
47-
;
4845
} catch (...) {
4946
throw jsi::JSError(runtime, "Unknown error");
50-
return jsi::Value();
51-
;
5247
}
5348
});
5449
}

0 commit comments

Comments
 (0)