Commit afe8824b by Corentin Wallez Committed by Commit Bot

Fix standalone compilation on Mac

Apple Clang 8.1 doesn't allow implicit conversion from gl::Error to egl::Error with the egl::Error::Error(gl::Error&&) constructor. Same thing for gl and egl reversed. This commits add conversion constructors taking errors by value. There should be not performance impact for non-error code paths. BUG= Change-Id: I91acf094af923080780b91850146d71016ec5ebc Reviewed-on: https://chromium-review.googlesource.com/671284Reviewed-by: 's avatarCorentin Wallez <cwallez@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
parent a336b90f
......@@ -90,6 +90,7 @@ class ANGLE_NO_DISCARD Error final
// automatic error type conversion
inline Error(egl::Error &&eglErr);
inline Error(egl::Error eglErr);
inline Error &operator=(const Error &other);
inline Error &operator=(Error &&other);
......@@ -159,6 +160,7 @@ class ANGLE_NO_DISCARD Error final
// automatic error type conversion
inline Error(gl::Error &&glErr);
inline Error(gl::Error glErr);
inline Error &operator=(const Error &other);
inline Error &operator=(Error &&other);
......
......@@ -45,6 +45,13 @@ Error::Error(egl::Error &&eglErr)
{
}
Error::Error(egl::Error eglErr)
: mCode(GL_INVALID_OPERATION),
mID(0),
mMessage(std::move(eglErr.mMessage))
{
}
Error &Error::operator=(const Error &other)
{
mCode = other.mCode;
......@@ -127,6 +134,13 @@ Error::Error(gl::Error &&glErr)
{
}
Error::Error(gl::Error glErr)
: mCode(EGL_BAD_ACCESS),
mID(0),
mMessage(std::move(glErr.mMessage))
{
}
Error &Error::operator=(const Error &other)
{
mCode = other.mCode;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment