libdivecomputer.h: fix warning with DC_VERSION on Win32

"warning: "DC_VERSION" redefined" is thrown if a chain of
includes previously includes windows.h:

In file included from c:/bin/mingw/i686-w64-mingw32/include/windows.h:71:0,
    from C:/bin/qt/5.5/mingw492_32/include/QtCore/qt_windows.h:63,
    from C:/bin/qt/5.5/mingw492_32/include/QtGui/qopengl.h:43,
    from C:/bin/qt/5.5/mingw492_32/include/QtQuick/qquickwindow.h:39,
    from C:/bin/qt/5.5/mingw492_32/include/QtQuick/QQuickWindow:1,
    from C:/dev/subsurface/subsurface-core/qt-gui.h:13,
    from C:\dev\subsurface\subsurface-mobile-main.cpp:9:

and which on it's own includes wingdi.h which defines
"DC_VERSION 10" (windows printer stack related).

To solve the warning DC_VERSION is undefined in
subsurface-core/libdivecomputer.h.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Lubomir I. Ivanov 2015-11-18 23:46:57 +02:00 committed by Dirk Hohndel
parent 5756ce281f
commit 694fc9d00f

View file

@ -3,6 +3,10 @@
/* libdivecomputer */
#ifdef DC_VERSION /* prevent a warning with wingdi.h */
#undef DC_VERSION
#endif
#include <libdivecomputer/version.h>
#include <libdivecomputer/device.h>
#include <libdivecomputer/parser.h>