From ce43d0ae9279edbf1ad108fe0d8325327a038d49 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Tue, 16 Feb 2016 11:26:51 +0200 Subject: use consistent #define checks for the Windows platform stage 1 of replacing usage of various checks for the windows platform with the compiler-defined '_WIN32' macro Change-Id: Iece73abdee530937e0737190b1aa97a46cd3075f Reviewed-on: https://gerrit.libreoffice.org/22390 Tested-by: Jenkins Reviewed-by: Michael Stahl --- hwpfilter/source/fontmap.cxx | 20 +++++++++----------- hwpfilter/source/hiodev.cxx | 2 +- hwpfilter/source/htags.cxx | 8 ++++---- hwpfilter/source/htags.h | 2 +- hwpfilter/source/hwpeq.cxx | 4 ++-- hwpfilter/source/hwpreader.cxx | 2 +- hwpfilter/source/lexer.cxx | 6 +++--- hwpfilter/source/mzstring.cxx | 14 +++----------- 8 files changed, 24 insertions(+), 34 deletions(-) (limited to 'hwpfilter') diff --git a/hwpfilter/source/fontmap.cxx b/hwpfilter/source/fontmap.cxx index 259722ee791d..8de154283ba1 100644 --- a/hwpfilter/source/fontmap.cxx +++ b/hwpfilter/source/fontmap.cxx @@ -117,8 +117,15 @@ const struct FontEntry FontMapTab[] = {"\xbd\xc5\xb8\xed \xb1\xc3\xbc\xad",3, 0.97} }; -#ifndef WIN32 -#if defined(LINUX) +#if defined(_WIN32) +const char* RepFontTab[] = +{ + "\xb9\xd9\xc5\xc1", /* 0 */ + "\xb5\xb8\xbf\xf2", /* 1 */ + "\xb1\xbc\xb8\xb2", /* 2 */ + "\xb1\xc3\xbc\xad" /* 3 */ +}; +#elif defined(LINUX) const char* RepFontTab[] = { "\xb9\xe9\xb9\xac \xb9\xd9\xc5\xc1", /* 0 */ @@ -135,15 +142,6 @@ const char* RepFontTab[] = "Gungso" /* 3 */ }; #endif -#else -const char* RepFontTab[] = -{ - "\xb9\xd9\xc5\xc1", /* 0 */ - "\xb5\xb8\xbf\xf2", /* 1 */ - "\xb1\xbc\xb8\xb2", /* 2 */ - "\xb1\xc3\xbc\xad" /* 3 */ -}; -#endif int getRepFamilyName(const char* orig, char *buf, double &ratio) { diff --git a/hwpfilter/source/hiodev.cxx b/hwpfilter/source/hiodev.cxx index b6195f0106e0..a5e035741dbb 100644 --- a/hwpfilter/source/hiodev.cxx +++ b/hwpfilter/source/hiodev.cxx @@ -20,7 +20,7 @@ #include #include -#ifdef WIN32 +#ifdef _WIN32 # include #else # include diff --git a/hwpfilter/source/htags.cxx b/hwpfilter/source/htags.cxx index 3bc004a89d26..044f7d2a6a61 100644 --- a/hwpfilter/source/htags.cxx +++ b/hwpfilter/source/htags.cxx @@ -52,7 +52,7 @@ EmPicture::EmPicture(size_t tsize) else data = new uchar[size]; } -#ifdef WIN32 +#ifdef _WIN32 #define unlink _unlink #endif EmPicture::~EmPicture() @@ -83,14 +83,14 @@ OlePicture::OlePicture(int tsize) size = tsize - 4; if (size <= 0) return; -#ifndef WIN32 +#ifndef _WIN32 pis = new char[size]; #endif }; OlePicture::~OlePicture() { -#ifdef WIN32 +#ifdef _WIN32 if( pis ) pis->Release(); #else @@ -109,7 +109,7 @@ void OlePicture::Read(HWPFile & hwpf) hwpf.Read4b(&signature, 1); if (signature != FILESTG_SIGNATURE_NORMAL) return; -#ifdef WIN32 +#ifdef _WIN32 char *data = new char[size]; if (hwpf.ReadBlock(data,size) == 0) { diff --git a/hwpfilter/source/htags.h b/hwpfilter/source/htags.h index 2e07978d23b5..292897b47bcd 100644 --- a/hwpfilter/source/htags.h +++ b/hwpfilter/source/htags.h @@ -55,7 +55,7 @@ struct OlePicture { int size; uint signature; -#ifdef WIN32 +#ifdef _WIN32 IStorage *pis; #else char *pis; diff --git a/hwpfilter/source/hwpeq.cxx b/hwpfilter/source/hwpeq.cxx index dfd2d0a88a8e..dd461103a1a6 100644 --- a/hwpfilter/source/hwpeq.cxx +++ b/hwpfilter/source/hwpeq.cxx @@ -33,7 +33,7 @@ using namespace std; #include /* @Man: change the hwp formula to LaTeX */ -#ifdef WIN32 +#ifdef _WIN32 # define ENDL "\r\n" #else /* !WIN32 */ # define ENDL "\n" @@ -48,7 +48,7 @@ using namespace std; #define IS_WS(ch) (strchr(WS, ch)) #define IS_BINARY(ch) (strchr("+-<=>", ch)) -#ifdef WIN32 +#ifdef _WIN32 #define STRICMP stricmp #else #define STRICMP strcasecmp diff --git a/hwpfilter/source/hwpreader.cxx b/hwpfilter/source/hwpreader.cxx index dab0d658a923..e981ce0a9238 100644 --- a/hwpfilter/source/hwpreader.cxx +++ b/hwpfilter/source/hwpreader.cxx @@ -3921,7 +3921,7 @@ void HwpReader::makePicture(Picture * hbox) } else{ if( hwpfile.oledata ){ -#ifdef WIN32 +#ifdef _WIN32 LPSTORAGE srcsto; LPUNKNOWN pObj; wchar_t pathname[200]; diff --git a/hwpfilter/source/lexer.cxx b/hwpfilter/source/lexer.cxx index e7518ab38c25..aa435d5fcdce 100644 --- a/hwpfilter/source/lexer.cxx +++ b/hwpfilter/source/lexer.cxx @@ -48,7 +48,7 @@ #ifdef __cplusplus #include -#ifndef WIN32 +#ifndef _WIN32 #include #else #include @@ -960,7 +960,7 @@ char *yytext; #include #include "nodes.h" -#ifdef WIN32 +#ifdef _WIN32 #define strdup _strdup #define fileno _fileno #define isatty _isatty @@ -975,7 +975,7 @@ int yywrap(); } #endif -#ifdef WIN32 +#ifdef _WIN32 extern YYSTYPE yylval; #endif #ifdef TOKEN_DEBUG diff --git a/hwpfilter/source/mzstring.cxx b/hwpfilter/source/mzstring.cxx index f5e7b9283a21..483809a5fbcb 100644 --- a/hwpfilter/source/mzstring.cxx +++ b/hwpfilter/source/mzstring.cxx @@ -23,22 +23,14 @@ #include "mzstring.h" -#ifndef WIN32 -#else - - #if defined _MSC_VER - #pragma warning(push, 1) - #endif +#ifdef _WIN32 # include - #if defined _MSC_VER - #pragma warning(pop) - #endif -#endif /* WIN32 */ +#endif #include #include #include -#ifndef WIN32 +#ifndef _WIN32 # define wsprintf sprintf #endif -- cgit