Add and improve pragmas for MSVC compiler.

* include/freetype/internal/ftdebug.h: Remove pragmas.
* include/freetype/internal/ftserv.h: Use push and pop for pragmas.
* include/freetype/internal/ftvalid.h: Handle warning C4324.
* src/base/ftobjs.c: Use push and pop for pragmas.
* src/gzip/ftgzip.c: Handle warning C4244.
This commit is contained in:
Werner Lemberg 2013-06-07 18:10:40 +02:00
parent 85fd84b828
commit 3f6e0e0c6b
6 changed files with 47 additions and 17 deletions

View File

@ -1,3 +1,13 @@
2013-06-07 Werner Lemberg <wl@gnu.org>
Add and improve pragmas for MSVC compiler.
* include/freetype/internal/ftdebug.h: Remove pragmas.
* include/freetype/internal/ftserv.h: Use push and pop for pragmas.
* include/freetype/internal/ftvalid.h: Handle warning C4324.
* src/base/ftobjs.c: Use push and pop for pragmas.
* src/gzip/ftgzip.c: Handle warning C4244.
2013-06-07 Werner Lemberg <wl@gnu.org>
[cff] s/cf2_getGlyphWidth/cf2_getGlyphOutline/.

View File

@ -248,15 +248,6 @@ FT_BEGIN_HEADER
ft_debug_init( void );
#if defined( _MSC_VER ) /* Visual C++ (and Intel C++) */
/* We disable the warning `conditional expression is constant' here */
/* in order to compile cleanly with the maximum level of warnings. */
#pragma warning( disable : 4127 )
#endif /* _MSC_VER */
FT_END_HEADER
#endif /* __FTDEBUG_H__ */

View File

@ -34,12 +34,12 @@
FT_BEGIN_HEADER
#if defined( _MSC_VER ) /* Visual C++ (and Intel C++) */
/* we disable the warning `conditional expression is constant' here */
/* in order to compile cleanly with the maximum level of warnings */
#if defined( _MSC_VER ) /* Visual C++ (and Intel C++) */
/* We disable the warning `conditional expression is */
/* constant' in order to compile cleanly with the maximum */
/* level of warnings. */
#pragma warning( push )
#pragma warning( disable : 4127 )
#endif /* _MSC_VER */
/*
@ -763,6 +763,10 @@ FT_BEGIN_HEADER
/* */
#if defined( _MSC_VER )
#pragma warning( pop )
#endif
FT_END_HEADER
#endif /* __FTSERV_H__ */

View File

@ -4,7 +4,7 @@
/* */
/* FreeType validation support (specification). */
/* */
/* Copyright 2004 by */
/* Copyright 2004, 2013 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -76,6 +76,14 @@ FT_BEGIN_HEADER
} FT_ValidationLevel;
#if defined( _MSC_VER ) /* Visual C++ (and Intel C++) */
/* We disable the warning `structure was padded due to */
/* __declspec(align())' in order to compile cleanly with */
/* the maximum level of warnings. */
#pragma warning( push )
#pragma warning( disable : 4324 )
#endif /* _MSC_VER */
/* validator structure */
typedef struct FT_ValidatorRec_
{
@ -88,8 +96,11 @@ FT_BEGIN_HEADER
} FT_ValidatorRec;
#if defined( _MSC_VER )
#pragma warning( pop )
#endif
#define FT_VALIDATOR( x ) ((FT_Validator)( x ))
#define FT_VALIDATOR( x ) ( (FT_Validator)( x ) )
FT_BASE( void )

View File

@ -51,6 +51,7 @@
/* possible loss of data' in order to compile cleanly with */
/* the maximum level of warnings: `md5.c' is non-FreeType */
/* code, and it gets used during development builds only. */
#pragma warning( push )
#pragma warning( disable : 4244 )
#endif /* _MSC_VER */
@ -60,7 +61,7 @@
#undef free
#if defined( _MSC_VER )
#pragma warning( default : 4244 )
#pragma warning( pop )
#endif
#endif /* FT_DEBUG_LEVEL_TRACE */

View File

@ -68,6 +68,15 @@
#undef SLOW
#define SLOW 1 /* we can't use asm-optimized sources here! */
#if defined( _MSC_VER ) /* Visual C++ (and Intel C++) */
/* We disable the warning `conversion from XXX to YYY, */
/* possible loss of data' in order to compile cleanly with */
/* the maximum level of warnings: zlib is non-FreeType */
/* code. */
#pragma warning( push )
#pragma warning( disable : 4244 )
#endif /* _MSC_VER */
/* Urgh. `inflate_mask' must not be declared twice -- C++ doesn't like
this. We temporarily disable it and load all necessary header files. */
#define NO_INFLATE_MASK
@ -87,6 +96,10 @@
#include "inflate.c"
#include "adler32.c"
#if defined( _MSC_VER )
#pragma warning( pop )
#endif
#endif /* !FT_CONFIG_OPTION_SYSTEM_ZLIB */