@@ -36,7 +36,7 @@ index 3cfc92533..9c487ac45 100644
36
36
37
37
#ifdef ANDROID
38
38
# include <android/log.h>
39
- + #elif defined(OHOS )
39
+ + #elif defined(XP_OHOS )
40
40
+ # include <hilog/log.h>
41
41
#endif
42
42
#ifdef MOZ_WIDGET_ANDROID
@@ -48,7 +48,7 @@ index 3cfc92533..9c487ac45 100644
48
48
- #ifndef ANDROID
49
49
+ #ifdef ANDROID
50
50
+ __android_log_print(ANDROID_LOG_ERROR, "Gecko", "mozalloc_abort: %s", msg);
51
- + #elif defined(OHOS )
51
+ + #elif defined(XP_OHOS )
52
52
+ (void) OH_LOG_Print(LOG_APP, LOG_ERROR, OHOS_LOG_DOMAIN, "Gecko",
53
53
+ "mozalloc_abort: %{public}s\n", msg);
54
54
+ #else
@@ -67,7 +67,7 @@ index 0b7395177..e84d76aba 100644
67
67
#endif
68
68
#ifdef ANDROID
69
69
# include <android/log.h>
70
- + #elif defined(OHOS )
70
+ + #elif defined(XP_OHOS )
71
71
+ # include <hilog/log.h>
72
72
#endif
73
73
@@ -76,7 +76,7 @@ index 0b7395177..e84d76aba 100644
76
76
MozWalkTheStackWithWriter(MOZ_ReportAssertionFailurePrintFrame, CallerPC(),
77
77
/* aMaxFrames */ 0);
78
78
# endif
79
- + #elif defined(OHOS )
79
+ + #elif defined(XP_OHOS )
80
80
+ (void) OH_LOG_Print(LOG_APP, LOG_FATAL, OHOS_LOG_DOMAIN, "MOZ_Assert",
81
81
+ "Assertion failure: %{public}s, at %{public}s:%{public}d\n",
82
82
+ aStr, aFilename, aLine);
@@ -87,7 +87,7 @@ index 0b7395177..e84d76aba 100644
87
87
__android_log_print(ANDROID_LOG_FATAL, "MOZ_CRASH",
88
88
"[%d] Hit MOZ_CRASH(%s) at %s:%d\n", MOZ_GET_PID(), aStr,
89
89
aFilename, aLine);
90
- + #elif defined(OHOS )
90
+ + #elif defined(XP_OHOS )
91
91
+ (void) OH_LOG_Print(LOG_APP, LOG_FATAL, OHOS_LOG_DOMAIN, "MOZ_CRASH",
92
92
+ "Hit MOZ_CRASH(%{public}s), at %{public}s:%{public}d\n",
93
93
+ aStr, aFilename, aLine);
@@ -105,7 +105,7 @@ index 3247b993c..c7039d5f8 100644
105
105
- #ifdef ANDROID
106
106
+ #if defined(ANDROID)
107
107
# include <android/log.h>
108
- + #elif defined(OHOS )
108
+ + #elif defined(XP_OHOS )
109
109
+ # include <hilog/log.h>
110
110
#endif
111
111
@@ -117,7 +117,7 @@ index 3247b993c..c7039d5f8 100644
117
117
- #ifdef ANDROID
118
118
+ #if defined(ANDROID)
119
119
__android_log_print(ANDROID_LOG_INFO, "Gecko", "%s", s.str().c_str());
120
- + #elif defined(OHOS )
120
+ + #elif defined(XP_OHOS )
121
121
+ (void) OH_LOG_Print(LOG_APP, LOG_INFO, OHOS_LOG_DOMAIN, "Gecko", "%{public}s\n", s.str().c_str());
122
122
#else
123
123
fputs(s.str().c_str(), stderr);
@@ -130,20 +130,20 @@ index c3a2ca89e..3fea33f4b 100644
130
130
131
131
#ifdef ANDROID
132
132
# include <android/log.h>
133
- + #elif defined(OHOS )
133
+ + #elif defined(XP_OHOS )
134
134
+ # include <hilog/log.h>
135
135
#endif
136
136
137
137
- #ifndef ANDROID
138
- + #if ! (defined(ANDROID) || defined(OHOS ))
138
+ + #if ! (defined(ANDROID) || defined(XP_OHOS ))
139
139
static void vprintf_stderr_buffered(const char* aFmt, va_list aArgs) {
140
140
// Avoid interleaving by writing to an on-stack buffer and then writing in one
141
141
// go with fputs, as long as the output fits into the buffer.
142
142
@@ -66,6 +68,10 @@ MFBT_API void vprintf_stderr(const char* aFmt, va_list aArgs) {
143
143
MFBT_API void vprintf_stderr(const char* aFmt, va_list aArgs) {
144
144
__android_log_vprint(ANDROID_LOG_INFO, "Gecko", aFmt, aArgs);
145
145
}
146
- + #elif defined(OHOS )
146
+ + #elif defined(XP_OHOS )
147
147
+ MFBT_API void vprintf_stderr(const char* aFmt, va_list aArgs) {
148
148
+ (void) OH_LOG_Print(LOG_APP, LOG_INFO, OHOS_LOG_DOMAIN, "Gecko", aFmt, aArgs);
149
149
+ }
@@ -155,7 +155,7 @@ index c3a2ca89e..3fea33f4b 100644
155
155
156
156
MFBT_API void print_stderr(std::stringstream& aStr) {
157
157
- #if defined(ANDROID)
158
- + #if defined(ANDROID) || defined(OHOS )
158
+ + #if defined(ANDROID) || defined(XP_OHOS )
159
159
// On Android logcat output is truncated to 1024 chars per line, and
160
160
// we usually use std::stringstream to build up giant multi-line gobs
161
161
// of output. So to avoid the truncation we find the newlines and
@@ -181,7 +181,7 @@ index 52bd6abc5..781402d56 100644
181
181
- #ifdef ANDROID
182
182
+ #if defined(ANDROID)
183
183
#include <android/log.h>
184
- + #elif defined(OHOS )
184
+ + #elif defined(XP_OHOS )
185
185
+ # include <hilog/log.h>
186
186
#endif
187
187
@@ -190,7 +190,7 @@ index 52bd6abc5..781402d56 100644
190
190
PR_Write(fd, buf, nb); \
191
191
} \
192
192
PR_END_MACRO
193
- + #elif defined(OHOS )
193
+ + #elif defined(XP_OHOS )
194
194
+ #define _PUT_LOG(fd, buf, nb) \
195
195
+ PR_BEGIN_MACRO \
196
196
+ if (fd == _pr_stderr) { \
@@ -210,7 +210,7 @@ index 52bd6abc5..781402d56 100644
210
210
PR_LogPrint("Aborting");
211
211
#ifdef ANDROID
212
212
__android_log_write(ANDROID_LOG_ERROR, "PRLog", "Aborting");
213
- + #elif defined(OHOS )
213
+ + #elif defined(XP_OHOS )
214
214
+ (void) OH_LOG_Print(LOG_APP, LOG_ERROR, OHOS_LOG_DOMAIN, "PRLog", "Aborting\n");
215
215
#endif
216
216
abort();
@@ -219,7 +219,7 @@ index 52bd6abc5..781402d56 100644
219
219
#elif defined(ANDROID)
220
220
__android_log_assert(NULL, "PRLog", "Assertion failure: %s, at %s:%d\n",
221
221
s, file, ln);
222
- + #elif defined(OHOS )
222
+ + #elif defined(XP_OHOS )
223
223
+ (void) OH_LOG_Print(LOG_APP, LOG_ERROR, OHOS_LOG_DOMAIN, "PRLog",
224
224
+ "Assertion failure: %{public}s, at %{public}s:%{public}d\n",s, file, ln);
225
225
#endif
0 commit comments