@@ -2,14 +2,16 @@ diff --git a/build/moz.configure/init.configure b/build/moz.configure/init.confi
22index e0e14bf60..179de2592 100644
33--- a/build/moz.configure/init.configure
44+++ b/build/moz.configure/init.configure
5- @@ -956,6 +956,7 @@ def target_is_ohos(target):
5+ @@ -956,7 +956,9 @@ def target_is_ohos(target):
66
77
88 set_define("XP_OHOS", target_is_ohos)
99+ set_config("OHOS", target_is_ohos)
10+ + set_define("OHOS_LOG_DOMAIN", "0xE0C4", when=target_is_ohos)
1011
1112
1213 @depends(target)
14+ def target_is_openbsd(target):
1315diff --git a/config/system-headers.mozbuild b/config/system-headers.mozbuild
1416index 471599f17..a89f0ca7a 100644
1517--- a/config/system-headers.mozbuild
@@ -47,7 +49,7 @@ index 3cfc92533..9c487ac45 100644
4749+ #ifdef ANDROID
4850+ __android_log_print(ANDROID_LOG_ERROR, "Gecko", "mozalloc_abort: %s", msg);
4951+ #elif defined(OHOS)
50- + (void) OH_LOG_Print(LOG_APP, LOG_ERROR, 0 , "Gecko",
52+ + (void) OH_LOG_Print(LOG_APP, LOG_ERROR, OHOS_LOG_DOMAIN , "Gecko",
5153+ "mozalloc_abort: %{public}s\n", msg);
5254+ #else
5355 fputs(msg, stderr);
@@ -75,7 +77,7 @@ index 0b7395177..e84d76aba 100644
7577 /* aMaxFrames */ 0);
7678 # endif
7779+ #elif defined(OHOS)
78- + (void) OH_LOG_Print(LOG_APP, LOG_FATAL, 0 , "MOZ_Assert",
80+ + (void) OH_LOG_Print(LOG_APP, LOG_FATAL, OHOS_LOG_DOMAIN , "MOZ_Assert",
7981+ "Assertion failure: %{public}s, at %{public}s:%{public}d\n",
8082+ aStr, aFilename, aLine);
8183 #else
@@ -86,7 +88,7 @@ index 0b7395177..e84d76aba 100644
8688 "[%d] Hit MOZ_CRASH(%s) at %s:%d\n", MOZ_GET_PID(), aStr,
8789 aFilename, aLine);
8890+ #elif defined(OHOS)
89- + (void) OH_LOG_Print(LOG_APP, LOG_FATAL, 0 , "MOZ_CRASH",
91+ + (void) OH_LOG_Print(LOG_APP, LOG_FATAL, OHOS_LOG_DOMAIN , "MOZ_CRASH",
9092+ "Hit MOZ_CRASH(%{public}s), at %{public}s:%{public}d\n",
9193+ aStr, aFilename, aLine);
9294 #else
@@ -116,7 +118,7 @@ index 3247b993c..c7039d5f8 100644
116118+ #if defined(ANDROID)
117119 __android_log_print(ANDROID_LOG_INFO, "Gecko", "%s", s.str().c_str());
118120+ #elif defined(OHOS)
119- + (void) OH_LOG_Print(LOG_APP, LOG_INFO, 0 , "Gecko", "%{public}s\n", s.str().c_str());
121+ + (void) OH_LOG_Print(LOG_APP, LOG_INFO, OHOS_LOG_DOMAIN , "Gecko", "%{public}s\n", s.str().c_str());
120122 #else
121123 fputs(s.str().c_str(), stderr);
122124 #endif
@@ -143,7 +145,7 @@ index c3a2ca89e..3fea33f4b 100644
143145 }
144146+ #elif defined(OHOS)
145147+ MFBT_API void vprintf_stderr(const char* aFmt, va_list aArgs) {
146- + (void) OH_LOG_Print(LOG_APP, LOG_INFO, 0 , "Gecko", aFmt, aArgs);
148+ + (void) OH_LOG_Print(LOG_APP, LOG_INFO, OHOS_LOG_DOMAIN , "Gecko", aFmt, aArgs);
147149+ }
148150 #elif defined(FUZZING_SNAPSHOT)
149151 MFBT_API void vprintf_stderr(const char* aFmt, va_list aArgs) {
@@ -194,7 +196,7 @@ index 52bd6abc5..781402d56 100644
194196+ if (fd == _pr_stderr) { \
195197+ char savebyte = buf[nb]; \
196198+ buf[nb] = '\0'; \
197- + (void) OH_LOG_Print(LOG_APP, LOG_INFO, 0 , "PRLog", \
199+ + (void) OH_LOG_Print(LOG_APP, LOG_INFO, OHOS_LOG_DOMAIN , "PRLog", \
198200+ "%{public}s\n", buf); \
199201+ buf[nb] = savebyte; \
200202+ } else { \
@@ -209,7 +211,7 @@ index 52bd6abc5..781402d56 100644
209211 #ifdef ANDROID
210212 __android_log_write(ANDROID_LOG_ERROR, "PRLog", "Aborting");
211213+ #elif defined(OHOS)
212- + (void) OH_LOG_Print(LOG_APP, LOG_ERROR, 0 , "PRLog", "Aborting\n");
214+ + (void) OH_LOG_Print(LOG_APP, LOG_ERROR, OHOS_LOG_DOMAIN , "PRLog", "Aborting\n");
213215 #endif
214216 abort();
215217 }
@@ -218,11 +220,10 @@ index 52bd6abc5..781402d56 100644
218220 __android_log_assert(NULL, "PRLog", "Assertion failure: %s, at %s:%d\n",
219221 s, file, ln);
220222+ #elif defined(OHOS)
221- + (void) OH_LOG_Print(LOG_APP, LOG_ERROR, 0 , "PRLog",
223+ + (void) OH_LOG_Print(LOG_APP, LOG_ERROR, OHOS_LOG_DOMAIN , "PRLog",
222224+ "Assertion failure: %{public}s, at %{public}s:%{public}d\n",s, file, ln);
223225 #endif
224226 abort();
225227 }
226228- -
2272292.45.2
228-
0 commit comments