Skip to content

Commit

Permalink
QtGui: Disable Windows on ARM64 preprocessor conflict in QtOpenGL
Browse files Browse the repository at this point in the history
The Windows API MemoryBarrier function is actually a macro when
_M_ARM64 is defined and it conflicts with the MemoryBarrier method when
it's declared and used.

Task-number: QTBUG-77388
Change-Id: I762edfc4ca1a44cbe095724de708c7cdad34ae65
Reviewed-by: Laszlo Agocs <[email protected]>
  • Loading branch information
hmartinez82 committed Oct 21, 2019
1 parent a9dcd77 commit b61c616
Show file tree
Hide file tree
Showing 11 changed files with 111 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/gui/opengl/qopenglfunctions_4_2_compatibility.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@
#include <QtGui/QOpenGLVersionFunctions>
#include <QtGui/qopenglcontext.h>

// MemoryBarrier is a macro on some architectures on Windows
#ifdef Q_OS_WIN
#pragma push_macro("MemoryBarrier")
#undef MemoryBarrier
#endif

QT_BEGIN_NAMESPACE

class Q_GUI_EXPORT QOpenGLFunctions_4_2_Compatibility : public QAbstractOpenGLFunctions
Expand Down Expand Up @@ -5632,6 +5638,10 @@ inline void QOpenGLFunctions_4_2_Compatibility::glVertexAttribI1i(GLuint index,

QT_END_NAMESPACE

#ifdef Q_OS_WIN
#pragma pop_macro("MemoryBarrier")
#endif

#endif // QT_NO_OPENGL && !QT_OPENGL_ES_2

#endif
10 changes: 10 additions & 0 deletions src/gui/opengl/qopenglfunctions_4_2_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@
#include <QtGui/QOpenGLVersionFunctions>
#include <QtGui/qopenglcontext.h>

// MemoryBarrier is a macro on some architectures on Windows
#ifdef Q_OS_WIN
#pragma push_macro("MemoryBarrier")
#undef MemoryBarrier
#endif

QT_BEGIN_NAMESPACE

class Q_GUI_EXPORT QOpenGLFunctions_4_2_Core : public QAbstractOpenGLFunctions
Expand Down Expand Up @@ -3027,6 +3033,10 @@ inline void QOpenGLFunctions_4_2_Core::glDrawArraysInstancedBaseInstance(GLenum

QT_END_NAMESPACE

#ifdef Q_OS_WIN
#pragma pop_macro("MemoryBarrier")
#endif

#endif // QT_NO_OPENGL && !QT_OPENGL_ES_2

#endif
10 changes: 10 additions & 0 deletions src/gui/opengl/qopenglfunctions_4_3_compatibility.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@
#include <QtGui/QOpenGLVersionFunctions>
#include <QtGui/qopenglcontext.h>

// MemoryBarrier is a macro on some architectures on Windows
#ifdef Q_OS_WIN
#pragma push_macro("MemoryBarrier")
#undef MemoryBarrier
#endif

QT_BEGIN_NAMESPACE

class Q_GUI_EXPORT QOpenGLFunctions_4_3_Compatibility : public QAbstractOpenGLFunctions
Expand Down Expand Up @@ -5839,6 +5845,10 @@ inline void QOpenGLFunctions_4_3_Compatibility::glVertexAttribI1i(GLuint index,

QT_END_NAMESPACE

#ifdef Q_OS_WIN
#pragma pop_macro("MemoryBarrier")
#endif

#endif // QT_NO_OPENGL && !QT_OPENGL_ES_2

#endif
11 changes: 11 additions & 0 deletions src/gui/opengl/qopenglfunctions_4_3_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,13 @@
#include <QtGui/QOpenGLVersionFunctions>
#include <QtGui/qopenglcontext.h>

// MemoryBarrier is a macro on some architectures on Windows
#ifdef Q_OS_WIN
#pragma push_macro("MemoryBarrier")
#undef MemoryBarrier
#endif


QT_BEGIN_NAMESPACE

class Q_GUI_EXPORT QOpenGLFunctions_4_3_Core : public QAbstractOpenGLFunctions
Expand Down Expand Up @@ -3230,6 +3237,10 @@ inline void QOpenGLFunctions_4_3_Core::glClearBufferData(GLenum target, GLenum i

QT_END_NAMESPACE

#ifdef Q_OS_WIN
#pragma pop_macro("MemoryBarrier")
#endif

#endif // QT_NO_OPENGL && !QT_OPENGL_ES_2

#endif
10 changes: 10 additions & 0 deletions src/gui/opengl/qopenglfunctions_4_4_compatibility.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,12 @@

QT_BEGIN_NAMESPACE

// MemoryBarrier is a macro on some architectures on Windows
#ifdef Q_OS_WIN
#pragma push_macro("MemoryBarrier")
#undef MemoryBarrier
#endif

class Q_GUI_EXPORT QOpenGLFunctions_4_4_Compatibility : public QAbstractOpenGLFunctions
{
public:
Expand Down Expand Up @@ -5961,6 +5967,10 @@ inline void QOpenGLFunctions_4_4_Compatibility::glVertexP2ui(GLenum type, GLuint

QT_END_NAMESPACE

#ifdef Q_OS_WIN
#pragma pop_macro("MemoryBarrier")
#endif

#endif // QT_NO_OPENGL && !QT_OPENGL_ES_2

#endif
10 changes: 10 additions & 0 deletions src/gui/opengl/qopenglfunctions_4_4_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@
#include <QtGui/QOpenGLVersionFunctions>
#include <QtGui/qopenglcontext.h>

// MemoryBarrier is a macro on some architectures on Windows
#ifdef Q_OS_WIN
#pragma push_macro("MemoryBarrier")
#undef MemoryBarrier
#endif

QT_BEGIN_NAMESPACE

class Q_GUI_EXPORT QOpenGLFunctions_4_4_Core : public QAbstractOpenGLFunctions
Expand Down Expand Up @@ -3415,6 +3421,10 @@ inline void QOpenGLFunctions_4_4_Core::glBufferStorage(GLenum target, GLsizeiptr

QT_END_NAMESPACE

#ifdef Q_OS_WIN
#pragma pop_macro("MemoryBarrier")
#endif

#endif // QT_NO_OPENGL && !QT_OPENGL_ES_2

#endif
10 changes: 10 additions & 0 deletions src/gui/opengl/qopenglfunctions_4_5_compatibility.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@
#include <QtGui/QOpenGLVersionFunctions>
#include <QtGui/qopenglcontext.h>

// MemoryBarrier is a macro on some architectures on Windows
#ifdef Q_OS_WIN
#pragma push_macro("MemoryBarrier")
#undef MemoryBarrier
#endif

QT_BEGIN_NAMESPACE

class Q_GUI_EXPORT QOpenGLFunctions_4_5_Compatibility : public QAbstractOpenGLFunctions
Expand Down Expand Up @@ -6679,6 +6685,10 @@ inline void QOpenGLFunctions_4_5_Compatibility::glGetnMapdv(GLenum target, GLenu

QT_END_NAMESPACE

#ifdef Q_OS_WIN
#pragma pop_macro("MemoryBarrier")
#endif

#endif // QT_NO_OPENGL && !QT_OPENGL_ES_2

#endif
11 changes: 11 additions & 0 deletions src/gui/opengl/qopenglfunctions_4_5_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@
#include <QtGui/QOpenGLVersionFunctions>
#include <QtGui/qopenglcontext.h>

// MemoryBarrier is a macro on some architectures on Windows
#ifdef Q_OS_WIN
#pragma push_macro("MemoryBarrier")
#undef MemoryBarrier
#endif

QT_BEGIN_NAMESPACE

class Q_GUI_EXPORT QOpenGLFunctions_4_5_Core : public QAbstractOpenGLFunctions
Expand Down Expand Up @@ -4056,6 +4062,11 @@ inline void QOpenGLFunctions_4_5_Core::glClipControl(GLenum origin, GLenum depth

QT_END_NAMESPACE

#ifdef Q_OS_WIN
#pragma pop_macro("MemoryBarrier")
#endif


#endif // QT_NO_OPENGL && !QT_OPENGL_ES_2

#endif
10 changes: 10 additions & 0 deletions src/gui/opengl/qopenglversionfunctions.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@
#include <QtCore/qpair.h>
#include <QtGui/qopengl.h>

// MemoryBarrier is a macro on some architectures on Windows
#ifdef Q_OS_WIN
#pragma push_macro("MemoryBarrier")
#undef MemoryBarrier
#endif

QT_BEGIN_NAMESPACE

class QOpenGLContext;
Expand Down Expand Up @@ -1897,6 +1903,10 @@ class QOpenGLFunctions_4_5_DeprecatedBackend : public QOpenGLVersionFunctionsBac

QT_END_NAMESPACE

#ifdef Q_OS_WIN
#pragma pop_macro("MemoryBarrier")
#endif

#endif // QT_NO_OPENGL

#endif
9 changes: 9 additions & 0 deletions src/openglextensions/qopenglextensions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@
#include "qopenglextensions.h"
#include <QtGui/qopenglcontext.h>

// MemoryBarrier is a macro on some architectures on Windows
#ifdef Q_OS_WIN
#pragma push_macro("MemoryBarrier")
#undef MemoryBarrier
#endif

QT_BEGIN_NAMESPACE

QAbstractOpenGLExtension::~QAbstractOpenGLExtension()
Expand Down Expand Up @@ -7720,3 +7726,6 @@ bool QOpenGLExtension_QCOM_tiled_rendering::initializeOpenGLFunctions()

QT_END_NAMESPACE

#ifdef Q_OS_WIN
#pragma pop_macro("MemoryBarrier")
#endif
10 changes: 10 additions & 0 deletions src/openglextensions/qopenglextensions.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@

#include <QtGui/qopengl.h>

// MemoryBarrier is a macro on some architectures on Windows
#ifdef Q_OS_WIN
#pragma push_macro("MemoryBarrier")
#undef MemoryBarrier
#endif

QT_BEGIN_NAMESPACE

class QOpenGLContext;
Expand Down Expand Up @@ -19473,6 +19479,10 @@ inline void QOpenGLExtension_QCOM_tiled_rendering::glEndTilingQCOM(GLbitfield pr

QT_END_NAMESPACE

#ifdef Q_OS_WIN
#pragma pop_macro("MemoryBarrier")
#endif

#endif // QT_NO_OPENGL

#endif

0 comments on commit b61c616

Please sign in to comment.