plugins: image formats - fix odr violation

When linking Qt statically, the image fomats are not separated into
different DSOs.  when linking them into the same target, gcc warns
about an ODR violation between icohandler and bmphandler:

```
/usr/src/debug/qtbase/6.3.0-r0/build/include/QtGui/6.3.0/QtGui/private/../../../../../../git/src/gui/image/qbmphandler_p.h:69:8: warning: type ‘struct BMP_INFOHDR’ violates the C++ One Definition Rule [-Wodr]
/usr/src/debug/qtbase/6.3.0-r0/git/src/plugins/imageformats/ico/qicohandler.cpp:98: note: a different type is defined in another translation unit
/usr/src/debug/qtbase/6.3.0-r0/build/include/QtGui/6.3.0/QtGui/private/../../../../../../git/src/gui/image/qbmphandler_p.h:70:13: note: the first difference of corresponding definitions is field ‘biSize’
/usr/src/debug/qtbase/6.3.0-r0/git/src/plugins/imageformats/ico/qicohandler.cpp:87: note: a field of same name but different type is defined in another translation unit
/usr/src/debug/qtbase/6.3.0-r0/build/include/QtGui/6.3.0/QtGui/private/../../../../../../git/src/gui/image/qbmphandler_p.h:69:8: note: type ‘qint32’ should match type ‘struct quint32_le’
```

we therefore wrap the `BMP_INFOHDR` into an anonymous namespace

Change-Id: I0e6ee66dd09ebda0c3e399738b5c172a57beb8f4
Pick-to: 5.15 6.2 6.3
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
This commit is contained in:
Tim Blechmann 2022-05-05 10:15:34 +08:00 committed by Marc Mutz
parent 9bf52680bc
commit 3ce1642f4c

View File

@ -59,6 +59,8 @@ QT_BEGIN_NAMESPACE
Q_LOGGING_CATEGORY(lcIco, "qt.gui.imageio.ico")
namespace {
// These next two structs represent how the icon information is stored
// in an ICO file.
typedef struct
@ -98,6 +100,8 @@ typedef struct { // BMP information header
} BMP_INFOHDR ,*LPBMP_INFOHDR;
#define BMP_INFOHDR_SIZE 40
}
class ICOReader
{
public: