@@ -2,14 +2,16 @@ diff --git a/build/moz.configure/init.configure b/build/moz.configure/init.confi
2
2
index e0e14bf60..179de2592 100644
3
3
--- a/build/moz.configure/init.configure
4
4
+++ 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):
6
6
7
7
8
8
set_define("XP_OHOS", target_is_ohos)
9
9
+ set_config("OHOS", target_is_ohos)
10
+ + set_define("OHOS_LOG_DOMAIN", "0xE0C4", when=target_is_ohos)
10
11
11
12
12
13
@depends(target)
14
+ def target_is_openbsd(target):
13
15
diff --git a/config/system-headers.mozbuild b/config/system-headers.mozbuild
14
16
index 471599f17..a89f0ca7a 100644
15
17
--- a/config/system-headers.mozbuild
@@ -47,7 +49,7 @@ index 3cfc92533..9c487ac45 100644
47
49
+ #ifdef ANDROID
48
50
+ __android_log_print(ANDROID_LOG_ERROR, "Gecko", "mozalloc_abort: %s", msg);
49
51
+ #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",
51
53
+ "mozalloc_abort: %{public}s\n", msg);
52
54
+ #else
53
55
fputs(msg, stderr);
@@ -75,7 +77,7 @@ index 0b7395177..e84d76aba 100644
75
77
/* aMaxFrames */ 0);
76
78
# endif
77
79
+ #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",
79
81
+ "Assertion failure: %{public}s, at %{public}s:%{public}d\n",
80
82
+ aStr, aFilename, aLine);
81
83
#else
@@ -86,7 +88,7 @@ index 0b7395177..e84d76aba 100644
86
88
"[%d] Hit MOZ_CRASH(%s) at %s:%d\n", MOZ_GET_PID(), aStr,
87
89
aFilename, aLine);
88
90
+ #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",
90
92
+ "Hit MOZ_CRASH(%{public}s), at %{public}s:%{public}d\n",
91
93
+ aStr, aFilename, aLine);
92
94
#else
@@ -116,7 +118,7 @@ index 3247b993c..c7039d5f8 100644
116
118
+ #if defined(ANDROID)
117
119
__android_log_print(ANDROID_LOG_INFO, "Gecko", "%s", s.str().c_str());
118
120
+ #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());
120
122
#else
121
123
fputs(s.str().c_str(), stderr);
122
124
#endif
@@ -143,7 +145,7 @@ index c3a2ca89e..3fea33f4b 100644
143
145
}
144
146
+ #elif defined(OHOS)
145
147
+ 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);
147
149
+ }
148
150
#elif defined(FUZZING_SNAPSHOT)
149
151
MFBT_API void vprintf_stderr(const char* aFmt, va_list aArgs) {
@@ -194,7 +196,7 @@ index 52bd6abc5..781402d56 100644
194
196
+ if (fd == _pr_stderr) { \
195
197
+ char savebyte = buf[nb]; \
196
198
+ 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", \
198
200
+ "%{public}s\n", buf); \
199
201
+ buf[nb] = savebyte; \
200
202
+ } else { \
@@ -209,7 +211,7 @@ index 52bd6abc5..781402d56 100644
209
211
#ifdef ANDROID
210
212
__android_log_write(ANDROID_LOG_ERROR, "PRLog", "Aborting");
211
213
+ #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");
213
215
#endif
214
216
abort();
215
217
}
@@ -218,11 +220,10 @@ index 52bd6abc5..781402d56 100644
218
220
__android_log_assert(NULL, "PRLog", "Assertion failure: %s, at %s:%d\n",
219
221
s, file, ln);
220
222
+ #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",
222
224
+ "Assertion failure: %{public}s, at %{public}s:%{public}d\n",s, file, ln);
223
225
#endif
224
226
abort();
225
227
}
226
228
- -
227
229
2.45.2
228
-
0 commit comments