ref: 3f6e0e0c6b75c76def1cffe2967a1f5ace392007
parent: 85fd84b828d6ed51fc8b5ddb359b38fffaa67877
author: Werner Lemberg <[email protected]>
date: Fri Jun 7 14:10:40 EDT 2013
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.
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
2013-06-07 Werner Lemberg <[email protected]>
+ 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 <[email protected]>
+
[cff] s/cf2_getGlyphWidth/cf2_getGlyphOutline/.
* src/cff/cf2font.c, src/cff/cf2font.h, src/cff/cf2ft.c: Do it.
--- a/include/freetype/internal/ftdebug.h
+++ b/include/freetype/internal/ftdebug.h
@@ -248,15 +248,6 @@
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__ */
--- a/include/freetype/internal/ftserv.h
+++ b/include/freetype/internal/ftserv.h
@@ -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 */
/*
@@ -762,6 +762,10 @@
#define FT_SERVICE_TRUETYPE_GLYF_H <freetype/internal/services/svttglyf.h>
/* */
+
+#if defined( _MSC_VER )
+#pragma warning( pop )
+#endif
FT_END_HEADER
--- a/include/freetype/internal/ftvalid.h
+++ b/include/freetype/internal/ftvalid.h
@@ -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_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_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 )
--- a/src/base/ftobjs.c
+++ b/src/base/ftobjs.c
@@ -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 */
--- a/src/gzip/ftgzip.c
+++ b/src/gzip/ftgzip.c
@@ -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
@@ -86,6 +95,10 @@
#include "infblock.c"
#include "inflate.c"
#include "adler32.c"
+
+#if defined( _MSC_VER )
+#pragma warning( pop )
+#endif
#endif /* !FT_CONFIG_OPTION_SYSTEM_ZLIB */