As discussed in [1], `#include <sal/config.h` should be
at the top of each LibreOffice header and source file.
Therefore, include the header in the qt vcl plugin
headers and source files.
While at it, rearrange the existing includes to be
more consistently separated into groups, which are
then separated by empty lines (and ordered by descending
specificity, except for config headers that need to
come first), see also [2]:
* config headers
* module-local (i.e. vcl) includes
* includes for top-level include/ dir
* UNO headers
* external libraries
* C++ standard library
For Windows (see WIP change [3] adding support for
the qt6 VCL plugin on Windows), <sal/config.h> defines
the `_USE_MATH_DEFINES` macro. Having that defined
before including Qt headers makes sure it's taken
into account by those headers and prevents (re)defining
mathematical constants in those, which prevents build
errors like the following seen with the mentioned WIP
change on Windows otherwise:
[...]
[build CXX] vcl/qt6/QtTimer.cxx
C:\PROGRA~2\WI3CF2~1\10\Include\10.0.22621.0\ucrt\corecrt_math_defines.h(23): error C2220: the following warning is treated as an error
C:\PROGRA~2\WI3CF2~1\10\Include\10.0.22621.0\ucrt\corecrt_math_defines.h(23): warning C4005: 'M_E': macro redefinition
C:/Users/mwegh/development/git/qt5/qtbase/src/corelib/kernel/qmath.h(181): note: see previous definition of 'M_E'
C:\PROGRA~2\WI3CF2~1\10\Include\10.0.22621.0\ucrt\corecrt_math_defines.h(24): warning C4005: 'M_LOG2E': macro redefinition
C:/Users/mwegh/development/git/qt5/qtbase/src/corelib/kernel/qmath.h(185): note: see previous definition of 'M_LOG2E'
C:\PROGRA~2\WI3CF2~1\10\Include\10.0.22621.0\ucrt\corecrt_math_defines.h(25): warning C4005: 'M_LOG10E': macro redefinition
C:/Users/mwegh/development/git/qt5/qtbase/src/corelib/kernel/qmath.h(189): note: see previous definition of 'M_LOG10E'
C:\PROGRA~2\WI3CF2~1\10\Include\10.0.22621.0\ucrt\corecrt_math_defines.h(26): warning C4005: 'M_LN2': macro redefinition
C:/Users/mwegh/development/git/qt5/qtbase/src/corelib/kernel/qmath.h(193): note: see previous definition of 'M_LN2'
C:\PROGRA~2\WI3CF2~1\10\Include\10.0.22621.0\ucrt\corecrt_math_defines.h(27): warning C4005: 'M_LN10': macro redefinition
C:/Users/mwegh/development/git/qt5/qtbase/src/corelib/kernel/qmath.h(197): note: see previous definition of 'M_LN10'
C:\PROGRA~2\WI3CF2~1\10\Include\10.0.22621.0\ucrt\corecrt_math_defines.h(28): warning C4005: 'M_PI': macro redefinition
C:/Users/mwegh/development/git/qt5/qtbase/src/corelib/kernel/qmath.h(201): note: see previous definition of 'M_PI'
C:\PROGRA~2\WI3CF2~1\10\Include\10.0.22621.0\ucrt\corecrt_math_defines.h(29): warning C4005: 'M_PI_2': macro redefinition
C:/Users/mwegh/development/git/qt5/qtbase/src/corelib/kernel/qmath.h(205): note: see previous definition of 'M_PI_2'
C:\PROGRA~2\WI3CF2~1\10\Include\10.0.22621.0\ucrt\corecrt_math_defines.h(30): warning C4005: 'M_PI_4': macro redefinition
C:/Users/mwegh/development/git/qt5/qtbase/src/corelib/kernel/qmath.h(209): note: see previous definition of 'M_PI_4'
C:\PROGRA~2\WI3CF2~1\10\Include\10.0.22621.0\ucrt\corecrt_math_defines.h(31): warning C4005: 'M_1_PI': macro redefinition
C:/Users/mwegh/development/git/qt5/qtbase/src/corelib/kernel/qmath.h(213): note: see previous definition of 'M_1_PI'
C:\PROGRA~2\WI3CF2~1\10\Include\10.0.22621.0\ucrt\corecrt_math_defines.h(32): warning C4005: 'M_2_PI': macro redefinition
C:/Users/mwegh/development/git/qt5/qtbase/src/corelib/kernel/qmath.h(217): note: see previous definition of 'M_2_PI'
C:\PROGRA~2\WI3CF2~1\10\Include\10.0.22621.0\ucrt\corecrt_math_defines.h(33): warning C4005: 'M_2_SQRTPI': macro redefinition
C:/Users/mwegh/development/git/qt5/qtbase/src/corelib/kernel/qmath.h(221): note: see previous definition of 'M_2_SQRTPI'
C:\PROGRA~2\WI3CF2~1\10\Include\10.0.22621.0\ucrt\corecrt_math_defines.h(34): warning C4005: 'M_SQRT2': macro redefinition
C:/Users/mwegh/development/git/qt5/qtbase/src/corelib/kernel/qmath.h(225): note: see previous definition of 'M_SQRT2'
C:\PROGRA~2\WI3CF2~1\10\Include\10.0.22621.0\ucrt\corecrt_math_defines.h(35): warning C4005: 'M_SQRT1_2': macro redefinition
C:/Users/mwegh/development/git/qt5/qtbase/src/corelib/kernel/qmath.h(229): note: see previous definition of 'M_SQRT1_2'
[1] https://gerrit.libreoffice.org/c/core/+/199615/comment/7e66b595_fcc64e26/
[2] https://wiki.documentfoundation.org/Development/Code_Conventions#Header_Includes
[3] https://gerrit.libreoffice.org/c/core/+/199615
Change-Id: Ia52f5cfb8360e3b0de19404879d59131c63756b0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/202728
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins