diff options
author | Ashod Nakashian <ashodnakashian@yahoo.com> | 2015-11-10 20:47:58 -0500 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-11-12 10:55:41 +0000 |
commit | 1a494d9a00208eef790400bdbd8b3e5c7fed4886 (patch) | |
tree | 9e305bbf11be0aacfa3af942a7c250f423b629a9 /include | |
parent | d7801c39826f2f24f7340e1b25809d3bb65d6099 (diff) |
Windows header sanitization
Isolation of windows headers using prewin.h
and postwin.h headers and making headers
dependent on them more self contained.
Conversion of TCHAR to WCHAR and
LPCTSTR to LPCWSTR etc. and cleanup
of unnecessary casts.
Change-Id: I7eff5c477d9223a064bfb4d962ff6d61960ee69c
Reviewed-on: https://gerrit.libreoffice.org/19901
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/LibreOfficeKit/LibreOfficeKitInit.h | 3 | ||||
-rw-r--r-- | include/postwin.h | 13 | ||||
-rw-r--r-- | include/prewin.h | 6 | ||||
-rw-r--r-- | include/svtools/sores.hxx | 3 | ||||
-rw-r--r-- | include/systools/win32/qswin32.h | 6 | ||||
-rw-r--r-- | include/systools/win32/uwinapi.h | 11 |
6 files changed, 32 insertions, 10 deletions
diff --git a/include/LibreOfficeKit/LibreOfficeKitInit.h b/include/LibreOfficeKit/LibreOfficeKitInit.h index f18e3ca3c8e4..e2af1093c9bf 100644 --- a/include/LibreOfficeKit/LibreOfficeKitInit.h +++ b/include/LibreOfficeKit/LibreOfficeKitInit.h @@ -76,7 +76,8 @@ extern "C" #else - #include <windows.h> + #include "prewin.h" + #include "postwin.h" #define TARGET_LIB "sofficeapp" ".dll" #define TARGET_MERGED_LIB "mergedlo" ".dll" #define SEPARATOR '\\' diff --git a/include/postwin.h b/include/postwin.h index 769d2e68cbe1..e1e151dfcaaa 100644 --- a/include/postwin.h +++ b/include/postwin.h @@ -22,6 +22,13 @@ #undef Rectangle #undef DELETE #undef OPTIONAL +#undef PASSTHROUGH +#undef STRICT +#undef ABSOLUTE +#undef RELATIVE +#undef IGNORE +#undef IN +#undef OUT #undef Folder #undef GradientStyle_RECT @@ -64,6 +71,10 @@ #undef Yield +#undef GetTimeFormat + +#undef CompareString + /* new StretchBlt() Modes (simpler names) */ #ifndef STRETCH_ANDSCANS #define STRETCH_ANDSCANS 1 @@ -75,9 +86,11 @@ #define STRETCH_DELETESCANS 3 #endif +#ifdef __cplusplus extern "C" { BOOL WINAPI WIN_Rectangle( HDC hDC, int X1, int Y1, int X2, int Y2 ); } +#endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/prewin.h b/include/prewin.h index 24dd693254c2..d64d517bc6fe 100644 --- a/include/prewin.h +++ b/include/prewin.h @@ -24,6 +24,12 @@ #define Rectangle BLA_Rectangle #define Folder WIN_Folder #define GradientStyle_RECT WIN_GradientStyle_RECT +#ifndef IN +#define IN +#endif +#ifndef OUT +#define OUT +#endif #if !defined STRICT #define STRICT diff --git a/include/svtools/sores.hxx b/include/svtools/sores.hxx index fe46fa12cfdd..66146721b754 100644 --- a/include/svtools/sores.hxx +++ b/include/svtools/sores.hxx @@ -27,6 +27,9 @@ #define STR_FURTHER_OBJECT 32026 #define STR_UNKNOWN_SOURCE 32027 +#ifdef BMP_PLUGIN +#undef BMP_PLUGIN +#endif #define BMP_PLUGIN 32000 // Sot Format Strings diff --git a/include/systools/win32/qswin32.h b/include/systools/win32/qswin32.h index f32b69e6df42..3cee187e6818 100644 --- a/include/systools/win32/qswin32.h +++ b/include/systools/win32/qswin32.h @@ -32,10 +32,16 @@ # define QUICKSTART_CLASSNAME QUICKSTART_CLASSNAMEW # define QUICKSTART_WINDOWNAME QUICKSTART_WINDOWNAMEW # define SHUTDOWN_QUICKSTART_MESSAGE SHUTDOWN_QUICKSTART_MESSAGEW +# ifndef FindWindow +# define FindWindow FindWindowW +# endif #else # define QUICKSTART_CLASSNAME QUICKSTART_CLASSNAMEA # define QUICKSTART_WINDOWNAME QUICKSTART_WINDOWNAMEA # define SHUTDOWN_QUICKSTART_MESSAGE SHUTDOWN_QUICKSTART_MESSAGEA +# ifndef FindWindow +# define FindWindow FindWindowA +# endif #endif #endif // INCLUDED_SYSTOOLS_WIN32_QSWIN32_H diff --git a/include/systools/win32/uwinapi.h b/include/systools/win32/uwinapi.h index db2faead0c29..cf89806f87fb 100644 --- a/include/systools/win32/uwinapi.h +++ b/include/systools/win32/uwinapi.h @@ -27,15 +27,8 @@ # define _SHELL32_ #endif -#ifndef _WINDOWS_ -#ifdef _MSC_VER -# pragma warning(push,1) /* disable warnings within system headers */ -#endif -# include <windows.h> -#ifdef _MSC_VER -# pragma warning(pop) -#endif -#endif +#include "prewin.h" +#include "postwin.h" #ifdef __MINGW32__ #include <basetyps.h> |