office-gobmx/include/postwin.h
Stephan Bergmann c8fd1fb553 -Werror,-Wunused-macros (clang-cl)
...which started to hit me now either due to building against a recent Visual
Studio 2022 Preview 17.4 (which would presumably no longer define those macros
in some system headers, so that the #ifndef's started to kick in now), or due to
building against a more recent Windows SDK (see below), no idea which.

But just dropping the seemingly unused macro definitions from the various .cxx
caused builds against old Windows SDK versions like Jenkins
<https://ci.libreoffice.org/job/gerrit_windows/139228/> to fail like

> C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\GdiplusTypes.h(479): error C3861: 'min': identifier not found
> C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\GdiplusTypes.h(480): error C3861: 'min': identifier not found
> C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\GdiplusTypes.h(481): error C3861: 'max': identifier not found
> C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\GdiplusTypes.h(482): error C3861: 'max': identifier not found
> C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\GdiplusTypes.h(503): error C3861: 'max': identifier not found
> C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\GdiplusTypes.h(504): error C3861: 'max': identifier not found
> C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\GdiplusTypes.h(505): error C3861: 'min': identifier not found
> C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\GdiplusTypes.h(506): error C3861: 'min': identifier not found
> C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\GdiplusTypes.h(667): error C3861: 'min': identifier not found
> C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\GdiplusTypes.h(668): error C3861: 'min': identifier not found
> C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\GdiplusTypes.h(669): error C3861: 'max': identifier not found
> C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\GdiplusTypes.h(670): error C3861: 'max': identifier not found
> C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\GdiplusTypes.h(691): error C3861: 'max': identifier not found
> C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\GdiplusTypes.h(692): error C3861: 'max': identifier not found
> C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\GdiplusTypes.h(693): error C3861: 'min': identifier not found
> C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\GdiplusTypes.h(694): error C3861: 'min': identifier not found
[...]
> make[1]: *** [C:/cygwin/home/tdf/jenkins/workspace/gerrit_windows/solenv/gbuild/LinkTarget.mk:334: C:/cygwin/home/tdf/jenkins/workspace/gerrit_windows/workdir/CxxObject/vcl/win/app/salinst.o] Error 2

so move those macro definitions to prewin.h (where they don't trigger clang-cl's
-Werror,-Wunused-macros from within an include file, even if they happen to be
unused in a translation unit).  (For simplicity, see whether it works in
practice to drop those #ifndef wrappers.  If they turn out to be relevant for
some build scenarios after all, they can be added back.)

Change-Id: I76d8794ae2de310bdca420e5488db2bc19de23ca
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142090
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-11-01 18:27:00 +01:00

58 lines
1.6 KiB
C

/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
/* not protected, do only include once! */
#undef ABSOLUTE
#undef CompareString
#undef CopyFile
#undef DELETE
#undef DocumentProperties
#undef DrawText
#undef FindWindow
#undef Folder
#undef GetCharWidth
#undef GetClassName
#undef GetGlyphOutline
#undef GetKerningPairs
#undef GetMetaFile
#undef GetNumberFormat
#undef GetObject
#undef GetPrinter
#undef GetTimeFormat
#undef GetUserName
#undef GradientStyle_RECT
#undef IGNORE
#undef IN
#undef OPAQUE // so it doesn't conflict with enum values
#undef OPTIONAL
#undef OUT
#undef PASSTHROUGH
#undef RELATIVE
#undef STRICT
#undef SetPort
#undef SetPrinter
#undef WB_LEFT
#undef WB_RIGHT
#undef Yield
#undef max
#undef mciSetCommand
#undef min
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */