-
Notifications
You must be signed in to change notification settings - Fork 129
Fix OHOS define #666
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix OHOS define #666
Conversation
880c396 to
f5b45b6
Compare
83f7fa6 to
32c419a
Compare
Signed-off-by: Jonathan Schwender <[email protected]>
Signed-off-by: Jonathan Schwender <[email protected]>
Assertions .h is also included in `c` files, so using namespaces is not an option to avoid the collision. js::LogLevel, collides with the hilog LogLevel enum. Signed-off-by: Jonathan Schwender <[email protected]>
Signed-off-by: Jonathan Schwender <[email protected]>
Signed-off-by: Jonathan Schwender <[email protected]>
32c419a to
79183e7
Compare
Signed-off-by: Jonathan Schwender <[email protected]>
|
Todo: add ci configuration for ohos with debugmozjs |
Signed-off-by: Jonathan Schwender <[email protected]>
Signed-off-by: Jonathan Schwender <[email protected]>
|
This PR did change a bit since the initial review, so it might make sense to be reviewed again. I'm not super happy with inlining the function declaration in every file it is used, but I don't think it would make the patching easier, if I wrapped the logging in a new header file. |
jdm
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's fair.
Extracted from #583.
target_is_ohoswas not working as expected. This presumably originated in a seemingly harmless suggestion,but surprisingly the expected return type / values for these functions is
True | None, and notTrue | False(The other functions liketarget_is_xxdon't return anything explicitly if theifdoes not match, which results in aNoneimplicitly I guess). ReturningFalsedoes not give the expected result. I noticed this while working on #583 - normally logs are still visible in servo, since we setup a thread that redirects output from stdout / stderr to the logging system on ohos (except in production mode).Fixing the ohos define also revealed some issues with the patches:
LogLeveldefined inhilog/log.hcollides with aLogLevelin thejsnamespace. Some of the header files we included hilog in, have this collision, and are also used from C files, so we can't just namespace the import (without the patch getting quite ugly).To avoid these issues we just copy the function declaration, and use raw integers instead of the enum in the function signature.